-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (40 loc) · 1.13 KB
/
Copy pathci.yml
File metadata and controls
47 lines (40 loc) · 1.13 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel in-progress runs on the same PR / branch when a new push arrives.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
uses: ./.github/workflows/_lint.yml
permissions:
contents: read
test:
uses: ./.github/workflows/_test.yml
permissions:
contents: read
ci-success:
# Single required-status-check target. Branch protection should require
# only this job; it summarizes lint + test matrix results so a failure
# in any matrix cell blocks merge.
name: "CI Success"
needs: [lint, test]
if: always()
runs-on: ubuntu-latest
env:
JOBS_JSON: ${{ toJSON(needs) }}
RESULTS_JSON: ${{ toJSON(needs.*.result) }}
EXIT_CODE: ${{!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && '0' || '1'}}
steps:
- name: Aggregate matrix results
run: |
echo "$JOBS_JSON"
echo "$RESULTS_JSON"
echo "Exiting with $EXIT_CODE"
exit $EXIT_CODE