-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Part of .github/workflows/changes.yml, separated for better syntax highlighting | ||
# > "If a new PR is opened, | ||
# > and it only changes 1 file, which test(s) should be re-run?" | ||
|
||
should-run-npm-test: | ||
- '{jsapp,test,webpack,static,scripts}/**/*.!(md|py|sh|bash)' # frontend | ||
- '{package*.json,patches/*.patch,scripts/copy_fonts.py}' # npm + postinstall | ||
- '{tsconfig.json,.swcrc,.babelrc*,.browserslistrc}' # compilers | ||
- '{.editorconfig,.prettier*,.stylelint*,.eslint*,coffeelint*}' # linters | ||
- '{.gitignore}' # (can affect tools) | ||
- '.github/workflows/npm-test.yml' # ci | ||
|
||
should-run-pytest: | ||
- '{kpi,kobo,hub}/**/*.!(md)' # backend | ||
- 'dependencies/**/*.!(md)' # pip | ||
- 'pyproject.toml' # (can affect build/tests) | ||
- '.github/workflows/pytest.yml' # ci | ||
|
||
should-run-darker: | ||
- '{kpi,kobo,hub}/**/*.py' # .py | ||
- 'pyproject.toml' # rules | ||
- '.github/workflows/darker.yml' # ci | ||
|
||
new-files-at-root-level: | ||
# New and unrecognized files can affect CI test results. | ||
# - We usually want to err on the side of running tests | ||
# instead of skipping them. | ||
# - This filter is basically an inverted 'ignore' list of paths | ||
# we know about already. | ||
# - Add new entries into this list once they're accounted for | ||
# in the other lists. | ||
# (alphabetical order, folders-first) | ||
- '!(((\.github|\.storybook|\.tx|cypress|dependencies|docker|hub|jsapp|kobo|kpi|patches|scripts|static|test|webpack)/**)|(\.babelrc\.json|\.browserslistrc|\.coveragerc|\.dockerignore|\.editorconfig|\.eslintignore|\.eslintrc\.js|\.git-blame-ignore-revs|\.gitattributes|\.gitignore|\.gitlab-ci\.yml|\.gitmodules|\.node-version|\.nvmrc|\.prettierrc\.js|\.stylelintrc\.js|\.swcrc|CONTRIBUTING\.md|Dockerfile|LICENSE|README\.md|coffeelint\.json|dependabot\.yml|format-python\.sh|kpi\.code-workspace|locale|manage\.py|package-lock\.json|package\.json|pip-compile\.sh|pyproject\.toml|tsconfig\.json))' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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' |