Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update the CI to only run tests if relevant #1362

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,21 @@ jobs:
runs-on: ubuntu-latest
outputs:
matrix: ${{ env.MATRIX }}
code_change: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- name: Check for code changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
code:
- 'datashader/**'
- 'examples/**'
- 'pixi.toml'
- 'pyproject.toml'
- '.github/workflows/test.yaml'
- name: Set matrix option
run: |
if [[ '${{ github.event_name }}' == 'workflow_dispatch' ]]; then
Expand Down Expand Up @@ -98,6 +112,7 @@ jobs:
name: unit:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
if: needs.setup.outputs.code_change == 'true'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
Expand Down Expand Up @@ -126,6 +141,7 @@ jobs:
name: core:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
if: needs.setup.outputs.code_change == 'true'
strategy:
fail-fast: false
matrix:
Expand All @@ -139,3 +155,13 @@ jobs:
- name: Test Unit
run: |
pixi run -e ${{ matrix.environment }} test-unit

result_test_suite:
name: result:test
needs: [unit_test_suite, core_test_suite]
if: always()
runs-on: ubuntu-latest
steps:
- name: check for failures
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: echo job failed && exit 1