-
Notifications
You must be signed in to change notification settings - Fork 0
184 lines (172 loc) · 5.63 KB
/
Copy pathci.yml
File metadata and controls
184 lines (172 loc) · 5.63 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# CI — every PR. Fast gate: each job runs a Makefile target through the
# shared make-target action, so the same commands run locally. Format runs
# inside `analyze` (resolve-first, diff-fails-under-CI). Runner-agnostic —
# all jobs run on one configurable runner (default ubuntu).
name: CI
on:
pull_request:
branches: [prod, dev]
workflow_dispatch:
inputs:
runner:
description: "Runner for all jobs"
type: choice
options: [ubuntu-24.04, macos-14, windows-2025-vs2026]
default: ubuntu-24.04
permissions: {}
concurrency:
group: ci-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
env:
DEFAULT_RUNNER: ubuntu-24.04
jobs:
inputs:
name: Resolve inputs
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions: {}
outputs:
runner: ${{ steps.resolve.outputs.runner }}
steps:
- id: resolve
shell: bash
env:
OVERRIDE: ${{ inputs.runner }}
DEFAULT: ${{ env.DEFAULT_RUNNER }}
run: echo "runner=${OVERRIDE:-$DEFAULT}" >> "$GITHUB_OUTPUT"
changes:
name: Detect changes
needs: inputs
runs-on: ${{ needs.inputs.outputs.runner }}
timeout-minutes: 5
permissions:
contents: read # checkout + paths-filter, read-only
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: filter
with:
filters: |
code:
- 'lib/**'
- 'test/**'
- 'example/**'
- 'tool/**'
- 'pubspec.yaml'
- 'analysis_options.yaml'
- 'Makefile'
- '.github/**'
analyze:
name: Analyze
needs: [inputs, changes]
if: needs.changes.outputs.code == 'true'
runs-on: ${{ needs.inputs.outputs.runner }}
timeout-minutes: 20
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: whuppi/ci/actions/make-target@v2.0.5
with:
make-target: analyze
analyze-floor:
name: Analyze (floor deps)
needs: [inputs, changes]
if: needs.changes.outputs.code == 'true'
runs-on: ${{ needs.inputs.outputs.runner }}
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: whuppi/ci/actions/make-target@v2.0.5
with:
make-target: analyze-floor
platforms:
name: Platform support
needs: [inputs, changes]
if: needs.changes.outputs.code == 'true'
runs-on: ${{ needs.inputs.outputs.runner }}
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: whuppi/ci/actions/make-target@v2.0.5
with:
make-target: platforms
test:
name: Widget tests (host VM)
needs: [inputs, changes]
if: needs.changes.outputs.code == 'true'
runs-on: ${{ needs.inputs.outputs.runner }}
timeout-minutes: 25
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: whuppi/ci/actions/make-target@v2.0.5
with:
make-target: test
test-example:
name: Example journeys (host VM)
needs: [inputs, changes]
if: needs.changes.outputs.code == 'true'
runs-on: ${{ needs.inputs.outputs.runner }}
timeout-minutes: 25
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: whuppi/ci/actions/make-target@v2.0.5
with:
make-target: test-example
gate:
name: CI Gate
if: always()
needs: [inputs, changes, analyze, analyze-floor, platforms, test, test-example]
runs-on: ${{ needs.inputs.outputs.runner }}
timeout-minutes: 5
permissions: {}
steps:
- name: Evaluate
shell: bash
env:
CHANGES: ${{ needs.changes.result }}
CODE: ${{ needs.changes.outputs.code }}
ANALYZE: ${{ needs.analyze.result }}
ANALYZE_FLOOR: ${{ needs.analyze-floor.result }}
PLATFORMS: ${{ needs.platforms.result }}
TEST: ${{ needs.test.result }}
TEST_EXAMPLE: ${{ needs.test-example.result }}
run: |
# A failed (not skipped) changes job clears its outputs, so CODE
# arrives empty — which must NOT read as "doc-only". Gate on the job
# result before trusting its output.
if [[ "$CHANGES" != "success" ]]; then
echo "FAILED: change detection did not succeed (changes=$CHANGES)"
exit 1
fi
if [[ "$CODE" != "true" ]]; then
echo "Doc-only PR — CI gate passes"
exit 0
fi
if [[ "$ANALYZE" != "success" ]] || [[ "$ANALYZE_FLOOR" != "success" ]] || [[ "$PLATFORMS" != "success" ]] || [[ "$TEST" != "success" ]] || [[ "$TEST_EXAMPLE" != "success" ]]; then
echo "FAILED: analyze=$ANALYZE analyze-floor=$ANALYZE_FLOOR platforms=$PLATFORMS test=$TEST test-example=$TEST_EXAMPLE"
exit 1
fi
echo "All CI checks passed"