wip - ci: skip tests if unaffected #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: changes | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
jobs: | ||
changes: | ||
name: Detect files changed | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
npm-test: ${{ steps.filter.outputs.should-run-npm-test }} | ||
pytest: ${{ steps.filter.outputs.should-run-pytest }} | ||
darker: ${{ steps.filter.outputs.should-run-darker }} | ||
steps: | ||
- name: Checkout source code (merge ref) | ||
uses: actions/checkout@v4 | ||
- id: filter | ||
name: Detect files changed | ||
uses: dorny/paths-filter@v3 | ||
with: | ||
filters: .github/filters.yml | ||
# echoing (for testing purposes) | ||
- if: steps.filter.outputs.npm-test | ||
run: echo 'frontend files changed; should run npm-test.yml'\ | ||
- if: steps.filter.outputs.pytest | ||
run: echo 'backend files changed; should run pytest.yml' | ||
- if: steps.filter.outputs.darker | ||
run: echo 'python files changed; should run darker.yml' | ||
- if: steps.filter.outputs.ci | ||
run: echo 'selective ci filtering updated' | ||
- if: steps.filter.outputs.new-unknown-files: | ||
run: echo 'unlisted files changed; will likely run pytest and npm-test' |