File tree Expand file tree Collapse file tree 4 files changed +123
-2
lines changed
Expand file tree Collapse file tree 4 files changed +123
-2
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,39 @@ name: Deploy Documentation
22
33on :
44 push :
5+ branches :
6+ - main
57 pull_request :
68 workflow_dispatch :
79
810jobs :
11+ changed-files :
12+ name : Changed Files
13+ runs-on : ubuntu-latest
14+ outputs :
15+ docs-change : ${{ steps.changed-files.outputs.docs-change_any_modified == 'true' }}
16+
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 50 # Assume PRs are less than 50 commits
22+
23+ - name : Find changed files
24+ uses : tj-actions/changed-files@v44
25+ id : changed-files
26+ with :
27+ files_yaml : |
28+ docs-change:
29+ - .github/workflows/deploy-docs.yml
30+ - docs/**
31+ - package.json
32+ - package-lock.json
33+
934 vercel :
1035 runs-on : ubuntu-latest
36+ needs : [changed-files]
37+ if : ${{ needs.changed-files.outputs.docs-change == 'true' }}
1138
1239 steps :
1340 - name : Checkout Code
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ permissions:
1010
1111jobs :
1212 update_release_draft :
13+ runs-on : ubuntu-latest
1314 permissions :
1415 contents : write
1516 pull-requests : read
1617
17- runs-on : ubuntu-latest
1818 steps :
1919 # Drafts your next Release notes as Pull Requests are merged into "master"
2020 - uses : release-drafter/release-drafter@v6
Original file line number Diff line number Diff line change 11name : Linting
22
3- on : [push, pull_request]
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
48
59env :
610 PIP_DISABLE_PIP_VERSION_CHECK : 1
711
812jobs :
13+ changed-files :
14+ name : Changed Files
15+ runs-on : ubuntu-latest
16+ outputs :
17+ docs-change : ${{ steps.changed-files.outputs.docs-change_any_modified == 'true' }}
18+ python-change : ${{ steps.changed-files.outputs.python-change_any_modified == 'true' }}
19+ project-change : ${{ steps.changed-files.outputs.project-change_any_modified == 'true' }}
20+
21+ steps :
22+ - name : Checkout repository
23+ uses : actions/checkout@v4
24+ with :
25+ fetch-depth : 50 # Assume PRs are less than 50 commits
26+
27+ - name : Find changed files
28+ uses : tj-actions/changed-files@v44
29+ id : changed-files
30+ with :
31+ files_yaml : |
32+ common: &common
33+ - .github/workflows/linter.yml
34+
35+ docs-change:
36+ - *common
37+ - docs/**
38+ - package.json
39+ - package-lock.json
40+
41+ python-change:
42+ - *common
43+ - src/**
44+ - tests/**
45+ - ruff.toml
46+ - poetry.lock
47+ - pyproject.toml
48+
49+ project-change:
50+ - *common
51+ - package.json
52+ - .prettierignore
53+ - .github/ISSUE_TEMPLATE/**
54+ - .github/*.md
55+
956 lint-python :
1057 name : Python
1158 runs-on : ubuntu-latest
59+ needs : [changed-files]
60+ if : ${{ needs.changed-files.outputs.python-change == 'true' }}
1261
1362 steps :
1463 - name : Checkout repository
3382 lint-docs :
3483 name : Docs
3584 runs-on : ubuntu-latest
85+ needs : [changed-files]
86+ if : ${{ needs.changed-files.outputs.docs-change == 'true' }}
3687
3788 steps :
3889 - name : Checkout repository
56107 lint-project :
57108 name : Project
58109 runs-on : ubuntu-latest
110+ needs : [changed-files]
111+ if : ${{ needs.changed-files.outputs.project-change == 'true' }}
59112
60113 steps :
61114 - name : Checkout repository
86139 - name : Whether the whole linting suite passed
87140 uses : re-actors/alls-green@v1.2.2
88141 with :
142+ allowed-skips : ${{ toJSON(needs) }}
89143 jobs : ${{ toJSON(needs) }}
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ name: Run Test Suite
22
33on :
44 push :
5+ branches :
6+ - main
57 pull_request :
68 workflow_dispatch :
79
@@ -21,9 +23,44 @@ concurrency:
2123 group : ${{ github.workflow }}-${{ github.ref }}
2224
2325jobs :
26+ changed-files :
27+ name : Changed Files
28+ runs-on : ubuntu-latest
29+ outputs :
30+ docs-change : ${{ steps.changed-files.outputs.docs-change_any_modified == 'true' }}
31+ python-change : ${{ steps.changed-files.outputs.python-change_any_modified == 'true' }}
32+ project-change : ${{ steps.changed-files.outputs.project-change_any_modified == 'true' }}
33+
34+ steps :
35+ - name : Checkout repository
36+ uses : actions/checkout@v4
37+ with :
38+ fetch-depth : 50 # Assume PRs are less than 50 commits
39+
40+ - name : Find changed files
41+ uses : tj-actions/changed-files@v44
42+ id : changed-files
43+ with :
44+ files_yaml : |
45+ common: &common
46+ - .github/workflows/test-worker.yml
47+
48+ docs-change:
49+ - *common
50+ - docs/**
51+ - package.json
52+ - package-lock.json
53+
54+ python-change:
55+ - *common
56+ - src/**
57+ - tests/**
58+
2459 test-python :
2560 name : " ${{ matrix.python-version }} on ${{ matrix.os }}"
2661 runs-on : " ${{ matrix.os }}-latest"
62+ needs : [changed-files]
63+ if : ${{ needs.changed-files.outputs.python-change == 'true' }}
2764
2865 continue-on-error : ${{ startsWith(matrix.python-version, '~') }} # Allows unstable Python versions to fail
2966
5996 test-docs :
6097 name : Docs
6198 runs-on : ubuntu-latest
99+ needs : [changed-files]
100+ if : ${{ needs.changed-files.outputs.docs-change == 'true' }}
62101
63102 steps :
64103 - name : Checkout repository
89128 - name : Whether the whole test suite passed
90129 uses : re-actors/alls-green@v1.2.2
91130 with :
131+ allowed-skips : ${{ toJSON(needs) }}
92132 jobs : ${{ toJSON(needs) }}
You can’t perform that action at this time.
0 commit comments