diff --git a/.github/workflows/docs-integration-tests.yml b/.github/workflows/docs-integration-tests.yml index cb4add5ae..ed2720917 100644 --- a/.github/workflows/docs-integration-tests.yml +++ b/.github/workflows/docs-integration-tests.yml @@ -3,9 +3,13 @@ name: Docs Integration Tests on: pull_request_review: types: [submitted] + push: + branches: + - main + - dev jobs: test: - if: github.event.review.state == 'APPROVED' + if: github.event.review.state == 'APPROVED' || github.event_name == 'push' runs-on: ubuntu-latest strategy: fail-fast: false @@ -125,6 +129,7 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 + if: github.event_name == 'pull_request_review' with: files: | **.md @@ -136,7 +141,7 @@ jobs: echo "$file was changed" done - name: Run integration tests - if: steps.changed-files.outputs.any_changed == 'true' + if: steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'push' run: pytest -n auto tests/integration/test_code_blocks.py env: - DOCS_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + DOCS_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files || '' }} diff --git a/tests/integration/test_code_blocks.py b/tests/integration/test_code_blocks.py index a37e0d086..3a267a529 100644 --- a/tests/integration/test_code_blocks.py +++ b/tests/integration/test_code_blocks.py @@ -5,7 +5,7 @@ from tests.utils.code_blocks import get_all_code_blocks, check_py_string -if "DOCS_ALL_CHANGED_FILES" in os.environ: +if "DOCS_ALL_CHANGED_FILES" in os.environ and os.environ["DOCS_ALL_CHANGED_FILES"] != "": docs_all_changed_files = os.environ["DOCS_ALL_CHANGED_FILES"].split() all_code_blocks = [get_all_code_blocks(changed_file) for changed_file in docs_all_changed_files]