-
Notifications
You must be signed in to change notification settings - Fork 5
165 lines (158 loc) · 4.67 KB
/
push.yml
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
on: push
name: Validate
jobs:
fixup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ianwremmel/[email protected]
nopush:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ianwremmel/[email protected]
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- uses: actions/upload-artifact@v4
with:
name: action-dist
path: integrations/action/dist
- uses: actions/upload-artifact@v4
with:
name: buildkite-bin
path: integrations/check-run-reporter-buildkite-plugin/bin
lint:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- uses: actions/download-artifact@v4
with:
name: action-dist
path: integrations/action/dist
- run: npm ci
- run: npm run lint
env:
ESLINT_FORMAT_OPTIONS: '--format json-with-metadata --output-file reports/style/eslint.json'
TSC_OPTIONS: '| tee reports/style/tsc.log'
- uses: ./integrations/action
if: ${{ always() }}
with:
token: '62fe22eb-69e1-436d-b85a-82b14847e4cc'
label: ESLint
report: 'reports/style/eslint.json'
- uses: ./integrations/action
if: ${{ always() }}
with:
token: '62fe22eb-69e1-436d-b85a-82b14847e4cc'
label: TSC
report: 'reports/style/tsc.log'
test:
needs:
- build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
nodeCount: [2]
nodeIndex: [0, 1]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- uses: actions/download-artifact@v4
with:
name: action-dist
path: integrations/action/dist
- run: npm ci
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: ./integrations/action
id: split
with:
token: '62fe22eb-69e1-436d-b85a-82b14847e4cc'
label: Unit Tests
nodeCount: ${{ matrix.nodeCount }}
nodeIndex: ${{ matrix.nodeIndex }}
tests: 'src/**/*.spec.ts'
- run: npm test -- ${{ steps.split.outputs.tests }}
- uses: ./integrations/action
if: ${{ always() }}
with:
token: '62fe22eb-69e1-436d-b85a-82b14847e4cc'
label: Unit Tests
report: 'reports/junit/**/*.xml'
lint-integrations-buildkite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: 'docker://buildkite/plugin-linter'
with:
args: --id check-run-reporter/check-run-reporter --path /github/workspace/integrations/check-run-reporter-buildkite-plugin
test-integrations-buildkite:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
name: buildkite-bin
path: integrations/check-run-reporter-buildkite-plugin/bin
# artifacts strip file permissions
- run: chmod +x integrations/check-run-reporter-buildkite-plugin/bin/*
- run: ./integrations/check-run-reporter-buildkite-plugin/tests/bats/bin/bats ./integrations/check-run-reporter-buildkite-plugin/tests/*.bats
release:
needs:
- build
- fixup
- lint
- lint-integrations-buildkite
- nopush
- test
- test-integrations-buildkite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
# Remember: Can't use artifacts here because we need to build during
# semantic-release to figure out the version number. Also, artifacts mess
# with file permissions (like +x).
- run: npx semantic-release
env:
CHECK_RUN_REPORTER__INTEGRATIONS_PUBLISH_TOKEN: ${{ secrets.CHECK_RUN_REPORTER__INTEGRATIONS_PUBLISH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}