-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI to limit runs to modified files (#51)
* Add hard version limits to track in CI * Rename format.yml to style.yml * Use changes only build docs when they're changed * Add style checks to changes system * Fix typo with style checks * Add permissions scope to changes * Add debug job * Add debug to changes job * Check debug in change job * Remove debug statements
- Loading branch information
Showing
5 changed files
with
85 additions
and
40 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,53 @@ | ||
name: ci | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
concurrency: | ||
group: ci-${{github.ref}}-${{github.event.pull_request.number || github.run_number}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
docs: ${{ steps.filter.outputs.docs }} | ||
style: ${{ steps.filter.outputs.style }} | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2 | ||
if: ${{ github.event_name == 'push' }} | ||
with: | ||
fetch-depth: 0 | ||
|
||
# For pull requests it's not necessary to checkout the code | ||
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 | ||
id: filter | ||
with: | ||
filters: | | ||
docs: | ||
- '.github/**' | ||
- 'docs/**' | ||
style: | ||
- '.github/**' | ||
- 'bin/**' | ||
- 'configs/**' | ||
- 'docs/conf.py' | ||
- 'experiments/**' | ||
- 'repo/**' | ||
docs: | ||
if: ${{ needs.changes.outputs.docs == 'true' }} | ||
needs: changes | ||
uses: ./.github/workflows/docs.yml | ||
|
||
style: | ||
if: ${{ needs.changes.outputs.style == 'true' }} | ||
needs: changes | ||
uses: ./.github/workflows/style.yml |
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
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
black==23.10.1 | ||
flake8==6.1.0 |
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,27 @@ | ||
name: Linting & Style Checks | ||
on: | ||
# This Workflow can be triggered manually | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: '.github/workflows/requirements/style.txt' | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pip install -r .github/workflows/requirements/style.txt | ||
- name: Lint and Format Check with Flake8 and Black | ||
run: | | ||
black --diff --check . | ||
flake8 |