Skip to content

Commit 9433b67

Browse files
bkonturclaude
andauthored
Cleanup unused files and scope CI workflows (#266)
* Cleanup of unused files * Scope CI workflows to relevant file changes - console-ui CI: only runs on PRs targeting main with console-ui changes - deploy-console-ui: triggers on push to main (not console-ui branch) - check, check-runtime-migration, integration-test: skip when only console-ui or docs files change * Add gate jobs to CI workflows to avoid blocking PRs Replace paths-ignore with a changes detection job so workflows always trigger but skip heavy jobs when only console-ui/ or docs/ files change. Gate jobs (with if: always()) report status regardless, preventing required checks from blocking merges when skipped. - check.yml: add "All tests passed" gate job - check-runtime-migration.yml: update "All migrations passed" as gate - integration-test.yml: update "Integration Tests" as gate - check-console-ui.yml: also trigger on push to main * Extract changes detection into reusable workflow Deduplicate the changes job by moving it to check-changed-files.yml and calling it from check.yml, check-runtime-migration.yml, and integration-test.yml. * Revert reusable workflow, inline changes detection Reusable workflows referenced via local path don't work when the file is new and doesn't exist on the base branch yet, causing startup_failure on all calling workflows. Inline the changes detection job back into each workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add job name to check-console-ui and restore reusable workflow - Add "Check Console UI" name to build job for branch protection - Restore check-changed-files.yml (unused until it exists on main) * Change name --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9ec6ed0 commit 9433b67

16 files changed

+95
-405
lines changed

.devcontainer/devcontainer.json

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

.editorconfig

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check changed files
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
should-run:
7+
description: "Whether the workflow should run based on changed files"
8+
value: ${{ jobs.changes.outputs.should-run }}
9+
10+
jobs:
11+
changes:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
pull-requests: read
16+
outputs:
17+
should-run: ${{ steps.check.outputs.should-run }}
18+
steps:
19+
- id: check
20+
env:
21+
GH_TOKEN: ${{ github.token }}
22+
run: |
23+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
24+
FILES=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files --paginate --jq '.[].filename')
25+
elif [[ "${{ github.event_name }}" == "push" ]]; then
26+
FILES=$(gh api repos/${{ github.repository }}/compare/${{ github.event.before }}...${{ github.event.after }} --jq '.files[].filename')
27+
else
28+
echo "should-run=true" >> $GITHUB_OUTPUT
29+
exit 0
30+
fi
31+
if echo "$FILES" | grep -qvE '^(console-ui/|docs/)'; then
32+
echo "should-run=true" >> $GITHUB_OUTPUT
33+
else
34+
echo "should-run=false" >> $GITHUB_OUTPUT
35+
fi

.github/workflows/check-console-ui.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Check Console UI
22

33
on:
4+
push:
5+
branches: [main]
46
pull_request:
5-
branches: [console-ui, main]
6-
paths:
7-
- "console-ui/**"
8-
- ".github/workflows/check-console-ui.yml"
7+
branches: [main]
98

109
jobs:
1110
build:
11+
name: Check Console UI
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4

.github/workflows/check-runtime-migration.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Check Runtime Migrations
55

66
on:
77
push:
8-
branches: ["release-*"]
8+
branches: [main, "release-*"]
99
pull_request:
1010
workflow_dispatch:
1111
schedule:
@@ -21,7 +21,15 @@ concurrency:
2121
permissions: {}
2222

2323
jobs:
24+
changes:
25+
uses: ./.github/workflows/check-changed-files.yml
26+
permissions:
27+
contents: read
28+
pull-requests: read
29+
2430
runtime-matrix:
31+
if: needs.changes.outputs.should-run == 'true'
32+
needs: [changes]
2533
runs-on: ubuntu-latest
2634
outputs:
2735
runtime: ${{ steps.runtime.outputs.runtime }}
@@ -206,7 +214,10 @@ jobs:
206214
confirmMigrationsPassed:
207215
runs-on: ubuntu-latest
208216
name: All migrations passed
209-
if: github.event_name != 'schedule' && github.event_name != 'workflow_dispatch'
210-
needs: [check-migrations]
217+
if: always() && github.event_name != 'schedule' && github.event_name != 'workflow_dispatch'
218+
needs: [changes, check-migrations]
211219
steps:
220+
- name: Decide outcome
221+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
222+
run: exit 1
212223
- run: echo '### Good job! All the migrations passed 🚀' >> $GITHUB_STEP_SUMMARY

.github/workflows/check.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ env:
2727
FRAME_OMNI_BENCHER_BIN_DIR: ${{ github.workspace }}/.frame-omni-bencher-bin
2828

2929
jobs:
30+
changes:
31+
uses: ./.github/workflows/check-changed-files.yml
32+
permissions:
33+
contents: read
34+
pull-requests: read
35+
3036
set-image:
37+
if: needs.changes.outputs.should-run == 'true'
38+
needs: [changes]
3139
# This workaround sets the container image for each job using 'set-image' job output.
3240
# env variables don't work for PRs from forks, so we need to use outputs.
3341
runs-on: ubuntu-latest
@@ -200,3 +208,13 @@ jobs:
200208
- name: Run production check for Westend parachain
201209
run: |
202210
cargo check --profile production -p bulletin-westend-runtime
211+
212+
all-tests-passed:
213+
name: All tests passed
214+
if: always()
215+
needs: [changes, clippy, test, benchmarks]
216+
runs-on: ubuntu-latest
217+
steps:
218+
- name: Decide outcome
219+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
220+
run: exit 1

.github/workflows/deploy-console-ui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Console UI to GitHub Pages
22

33
on:
44
push:
5-
branches: [console-ui]
5+
branches: [main]
66
paths:
77
- "console-ui/**"
88
- ".github/workflows/deploy-console-ui.yml"

.github/workflows/integration-test.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ env:
2424
ZOMBIENET_BIN_DIR: ${{ github.workspace }}/.zombienet-bin
2525

2626
jobs:
27+
changes:
28+
uses: ./.github/workflows/check-changed-files.yml
29+
permissions:
30+
contents: read
31+
pull-requests: read
32+
2733
setup:
34+
if: needs.changes.outputs.should-run == 'true'
35+
needs: [changes]
2836
name: Setup
2937
runs-on: ubuntu-latest
3038
steps:
@@ -90,6 +98,8 @@ jobs:
9098
chmod +x zombienet-linux-x64
9199
92100
runtime-matrix:
101+
if: needs.changes.outputs.should-run == 'true'
102+
needs: [changes]
93103
runs-on: ubuntu-latest
94104
outputs:
95105
runtime: ${{ steps.runtime.outputs.runtime }}
@@ -229,16 +239,13 @@ jobs:
229239
${{ env.TEST_DIR }}/*.log
230240
231241
integration-tests-complete:
232-
name: Integration Tests
233-
needs: [integration-tests]
242+
name: All integration tests passed
243+
needs: [changes, integration-tests]
234244
if: always()
235245
runs-on: ubuntu-latest
236246
steps:
237-
- name: Check integration test results
238-
env:
239-
TEST_RESULT: ${{ needs.integration-tests.result }}
247+
- name: Decide outcome
248+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
240249
run: |
241-
if [ "$TEST_RESULT" != "success" ]; then
242-
echo "Integration tests failed or were cancelled"
243-
exit 1
244-
fi
250+
echo "Integration tests failed or were cancelled"
251+
exit 1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
.envrc
1111
.direnv
1212
.idea
13+
.vscode
1314

1415
# Node.js
1516
**/node_modules/

.vscode/tasks.json

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

0 commit comments

Comments
 (0)