Skip to content

Commit

Permalink
Run pytest in CI only in PRs that update either sources or tests (a…
Browse files Browse the repository at this point in the history
…mi-iit#80)

* Prevent running `pytest` in CI on PRs with no code changes
  • Loading branch information
diegoferigo authored Feb 5, 2024
1 parent e2ea0e8 commit 217f743
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,32 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src: &src
- 'src/**'
tests: &tests
- 'tests/**'
src_and_tests:
- *src
- *tests
- name: Install Gazebo Classic
if: contains(matrix.os, 'ubuntu')
if: |
contains(matrix.os, 'ubuntu') &&
(github.event_name != 'pull_request' ||
steps.changes.outputs.src_and_tests == 'true')
run: |
sudo apt-get update
sudo apt-get install gazebo
- name: Run the Python tests
if: contains(matrix.os, 'ubuntu')
if: |
contains(matrix.os, 'ubuntu') &&
(github.event_name != 'pull_request' ||
steps.changes.outputs.src_and_tests == 'true')
run: pytest
env:
JAX_PLATFORM_NAME: cpu
Expand Down

0 comments on commit 217f743

Please sign in to comment.