-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (121 loc) · 3.47 KB
/
ci.yml
File metadata and controls
130 lines (121 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: {}
# Cancel superseded runs on the same PR / branch so the single
# self-hosted GPU runner isn't blocked by stale jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# ---------- Change detection ----------
changes:
name: Detect Changes
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: read
outputs:
ci: ${{ steps.filter.outputs.ci }}
rust: ${{ steps.filter.outputs.rust }}
ui: ${{ steps.filter.outputs.ui }}
plugins: ${{ steps.filter.outputs.plugins }}
e2e: ${{ steps.filter.outputs.e2e }}
steps:
- uses: actions/checkout@v5
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ci:
- '.github/**'
rust:
- 'crates/**'
- 'apps/**'
- 'sdks/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'deny.toml'
- 'rust-toolchain.toml'
- 'clippy.toml'
- 'rustfmt.toml'
- '.cargo/config.toml'
ui:
- 'ui/**'
plugins:
- 'plugins/native/**'
e2e:
- 'e2e/**'
# ---------- Sub-workflows ----------
skit:
name: Skit
needs: changes
if: >-
github.event_name == 'workflow_dispatch' ||
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.rust == 'true' ||
needs.changes.outputs.ui == 'true'
uses: ./.github/workflows/skit.yml
ui:
name: UI
needs: changes
if: >-
github.event_name == 'workflow_dispatch' ||
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.ui == 'true'
uses: ./.github/workflows/ui.yml
plugins:
name: Plugins
needs: changes
if: >-
github.event_name == 'workflow_dispatch' ||
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.plugins == 'true' ||
needs.changes.outputs.rust == 'true'
uses: ./.github/workflows/plugins.yml
e2e:
name: E2E
needs: changes
if: >-
github.event_name == 'workflow_dispatch' ||
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.rust == 'true' ||
needs.changes.outputs.ui == 'true' ||
needs.changes.outputs.e2e == 'true'
uses: ./.github/workflows/e2e.yml
# ---------- Always-run checks ----------
reuse:
name: REUSE Compliance
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: fsfe/reuse-action@v6
# ---------- Gate ----------
all-checks:
name: All Checks Passed
if: always()
runs-on: ubuntu-22.04
needs: [changes, skit, ui, plugins, e2e, reuse]
steps:
- name: Verify results
run: |
results=(
"${{ needs.changes.result }}"
"${{ needs.skit.result }}"
"${{ needs.ui.result }}"
"${{ needs.plugins.result }}"
"${{ needs.e2e.result }}"
"${{ needs.reuse.result }}"
)
for r in "${results[@]}"; do
if [[ "$r" == "failure" || "$r" == "cancelled" ]]; then
echo "::error::CI check failed or was cancelled ($r)"
exit 1
fi
done
echo "All checks passed or were appropriately skipped."