Skip to content

Commit

Permalink
test: use filters to prevent redundant runs
Browse files Browse the repository at this point in the history
Only when the code changed would tests has to be run. This prevents
the large test matrix from eating up the API quota.
  • Loading branch information
alaviss committed Jan 31, 2024
1 parent 5fe177b commit 2b4a5d2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,27 @@ on:
- cron: "0 0 * * 0"

jobs:
filter:
name: Check if tests should be run
runs-on: ubuntu-latest
outputs:
should-skip: ${{ steps.filter.should_skip }}

steps:
- uses: fkirc/[email protected]
id: filter
with:
# Only run when code used by the action changed.
paths: |
[
"dist/**",
".github/nimskull-problem-matcher.json",
".github/workflows/test.yml"
]
check:
needs: filter
if: needs.filter.outputs.should-skip != 'true'
strategy:
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
Expand Down

0 comments on commit 2b4a5d2

Please sign in to comment.