Skip to content

Commit

Permalink
Run integration tests on push to main and dev (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
vachillo authored May 21, 2024
1 parent 540e8f3 commit 9db5c8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/docs-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 || '' }}
2 changes: 1 addition & 1 deletion tests/integration/test_code_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9db5c8d

Please sign in to comment.