Skip to content

Commit 07c5831

Browse files
committed
modernize cdm-ci workflows to avoid collisions
- previously it was possible for both the "real" and the "faux" workflows to execute because the rules to execute both were met and it was difficult/impossible to write the rules in a way where that didn't happen; when that occurred the "faux" workflow would pass which would render the result of the "real" workflow irrelevant; in that situation if the users were not paying special attention and being very careful it was possible for code that failed the "real" ci workflow to be merged which is highly undesirable - the new approach uses a 3rd party action to allow for more flexible rule authoring to solve this problem and now the "real" and "faux" paths are truly mutually exclusive
1 parent 3161778 commit 07c5831

2 files changed

Lines changed: 44 additions & 39 deletions

File tree

.github/workflows/cdm-ci.yaml

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,67 @@
11
name: cdm-ci
22

3-
# Controls when the action will run.
43
on:
5-
# Triggers the workflow on pull request events but only for the master branch
6-
# ignore pull requests that only change documentation/license files
74
pull_request:
85
branches: [ master ]
9-
paths-ignore:
10-
- LICENSE
11-
- '**.md'
12-
- '.github/rulesets/**'
13-
- .github/workflows/run-crucible-tracking.yaml
14-
- .github/workflows/faux-crucible-ci.yaml
15-
- .github/workflows/faux-cdm-ci.yaml
16-
- 'docs/**'
17-
18-
# Allows you to run this workflow manually from the Actions tab
196
workflow_dispatch:
207

218
concurrency:
229
group: ${{ github.ref }}/cdm-ci
2310
cancel-in-progress: true
2411

2512
jobs:
26-
# Job to test installation
27-
cdm-ci:
28-
# Job will run on github-hosted runner
29-
runs-on: ubuntu-latest
13+
changes:
14+
runs-on: [ self-hosted, workflow-overhead ]
15+
outputs:
16+
real-ci: ${{ steps.filter.outputs.real-ci }}
17+
faux-ci: ${{ steps.filter.outputs.faux-ci }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dorny/paths-filter@v3
21+
id: filter
22+
with:
23+
filters: |
24+
real-ci:
25+
- '**'
26+
- '!LICENSE'
27+
- '!**.md
28+
- '!.github/rulesets/**'
29+
- '!.github/workflows/run-crucible-tracking.yaml'
30+
- '!.github/workflows/crucible-ci.yaml'
31+
- '!docs/**'
32+
faux-ci:
33+
- 'LICENSE'
34+
- '**.md
35+
- '.github/rulesets/**'
36+
- '.github/workflows/run-crucible-tracking.yaml'
37+
- '.github/workflows/crucible-ci.yaml'
38+
- 'docs/**'
3039
31-
# Steps represent a sequence of tasks that will be executed as part of the job
40+
real-cdm-ci:
41+
runs-on: ubuntu-latest
42+
needs: changes
43+
if: ${{ needs.changes.outputs.real-ci == 'true' }}
3244
steps:
33-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3445
- uses: actions/checkout@v4
3546
- uses: actions/setup-node@v3
3647
with:
37-
node-version: "20.7.0"
48+
node-version: "22.22.0"
3849
- name: fail if javascript files are not formatted
3950
run: npx prettier **/*.js --check
4051
env:
4152
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4253

4354

55+
faux-cdm-ci:
56+
runs-on: [ self-hosted, workflow-overhead ]
57+
needs: changes
58+
if: ${{ needs.changes.outputs.faux-ci == 'true' && needs.changes.outputs.real-ci == 'false' }
59+
steps:
60+
- run: 'echo "faux-cdm-ci-complete"'
61+
62+
cmd-ci:
63+
runs-on: [ self-hosted, workflow-overhead ]
64+
needs: [ real-cdm-ci, faux-cdm-ci ]
65+
if: always()
66+
steps:
67+
- run: 'echo "cdm-ci complete"'

.github/workflows/faux-cdm-ci.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)