-
Notifications
You must be signed in to change notification settings - Fork 10
98 lines (81 loc) · 2.16 KB
/
ci.yaml
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
name: CI
on:
pull_request:
branches:
- main
schedule:
- cron: 0 1 * * 1-5
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Buf
uses: bufbuild/[email protected]
with:
github_token: ${{ github.token }}
- name: Set up Node.js
uses: ./.github/actions/setup-node
- name: Lint code
run: pnpm run lint
- name: Generate code
run: pnpm run generate
- name: Generate docs
run: pnpm run docs
- name: Check for uncommitted changes
run: |-
if [[ -n $(git status --porcelain) ]]; then
echo "::error::Uncommitted changes detected"
git -c color.ui=always status -vv
exit 1
fi
test-matrix:
name: Generate test matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.test-matrix.outputs.matrix }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Node.js
uses: ./.github/actions/setup-node
with:
only-scripts: true
- id: test-matrix
name: Generate test matrix
run: pnpm run test:matrix
env:
GITHUB_TOKEN: ${{ github.token }}
test:
name: Test (${{ matrix.title }})
runs-on: ubuntu-latest
continue-on-error: ${{ github.event_name != 'schedule' && !matrix.required }}
needs:
- test-matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.test-matrix.outputs.matrix) }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Node.js
uses: ./.github/actions/setup-node
with:
node-version: ${{ matrix.node }}
save-cache: false
- name: Set up tests
if: matrix.setup
run: ${{ matrix.setup }}
- name: Run tests
run: ${{ matrix.test }}
test-results:
name: Check test results
runs-on: ubuntu-latest
if: always()
needs:
- test
steps:
- name: Check test results
run: test "${{ needs.test.result }}" = "success"