diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 796d66e679..99df2f7d72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: label: Run Collection Tests - name: api-schema label: Check API Schema - command: /start_tests.sh detect-schema-change + command: /start_tests.sh detect-schema-change SCHEMA_DIFF_BASE_BRANCH=${{ github.event.pull_request.base.ref }} - name: ui-lint label: Run UI Linters command: make ui-lint diff --git a/.github/workflows/upload_schema.yml b/.github/workflows/upload_schema.yml index 52d98512e5..b7bbfcca2e 100644 --- a/.github/workflows/upload_schema.yml +++ b/.github/workflows/upload_schema.yml @@ -47,6 +47,6 @@ jobs: run: | ansible localhost -c local, -m command -a "{{ ansible_python_interpreter + ' -m pip install boto3'}}" ansible localhost -c local -m aws_s3 \ - -a 'src=${{ github.workspace }}/schema.json bucket=awx-public-ci-files object=schema.json mode=put permission=public-read' + -a "src=${{ github.workspace }}/schema.json bucket=awx-public-ci-files object=${GITHUB_REF##*/}/schema.json mode=put permission=public-read" diff --git a/Makefile b/Makefile index 2b9372b8d1..c603e6239d 100644 --- a/Makefile +++ b/Makefile @@ -470,8 +470,9 @@ docker-compose-runtest: awx/projects docker-compose-sources docker-compose-build-swagger: awx/projects docker-compose-sources docker-compose -f tools/docker-compose/_sources/docker-compose.yml run --rm --service-ports --no-deps awx_1 /start_tests.sh swagger +SCHEMA_DIFF_BASE_BRANCH ?= devel detect-schema-change: genschema - curl https://s3.amazonaws.com/awx-public-ci-files/schema.json -o reference-schema.json + curl https://s3.amazonaws.com/awx-public-ci-files/$(SCHEMA_DIFF_BASE_BRANCH)/schema.json -o reference-schema.json # Ignore differences in whitespace with -b diff -u -b reference-schema.json schema.json diff --git a/tools/docker-compose/start_tests.sh b/tools/docker-compose/start_tests.sh index 66f4f8ed16..2e80679cb2 100755 --- a/tools/docker-compose/start_tests.sh +++ b/tools/docker-compose/start_tests.sh @@ -6,4 +6,9 @@ make clean make awx-link cp tools/docker-compose/ansible/roles/sources/files/local_settings.py awx/settings/local_settings.py -make "${1:-test}" + +if [[ ! $@ ]]; then + make test +else + make $@ +fi