Skip to content

Commit c2a152b

Browse files
committed
ci: add workflow jobs
1 parent 73914d4 commit c2a152b

File tree

1 file changed

+269
-1
lines changed

1 file changed

+269
-1
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 269 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,56 @@ on:
1111
- cron: '0 2 * * *'
1212

1313
jobs:
14+
build-and-test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
- name: Install dependencies
20+
run: npm install
21+
- name: Build
22+
run: npm run all:action
23+
- name: Publish Test Report
24+
uses: ./
25+
with:
26+
report-path: './ctrf/*.json'
27+
summary-report: true
28+
github-report: true
29+
failed-report: true
30+
flaky-report: true
31+
insights-report: true
32+
fail-rate-report: true
33+
flaky-rate-report: true
34+
slowest-report: true
35+
previous-results-report: true
36+
use-suite-name: true
37+
upload-artifact: true
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
if: always()
41+
- name: Publish Test Report
42+
uses: ./
43+
with:
44+
report-path: './ctrf/*.json'
45+
pull-request-report: true
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
if: always()
49+
standard-reports-test:
50+
needs: build-and-test
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
- name: Basic Test Report
56+
uses: ./
57+
with:
58+
report-path: './ctrf-reports/ctrf-report.json'
59+
summary-report: true
60+
annotate: false
61+
if: always()
1462
github-report-test:
63+
needs: build-and-test
1564
runs-on: ubuntu-latest
1665
steps:
1766
- name: Checkout code
@@ -25,4 +74,223 @@ jobs:
2574
env:
2675
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2776
if: always()
28-
77+
detailed-reports-test:
78+
needs: build-and-test
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Checkout code
82+
uses: actions/checkout@v4
83+
- name: Detailed Test Report
84+
uses: ./
85+
with:
86+
report-path: './ctrf-reports/ctrf-report.json'
87+
test-report: true
88+
test-list-report: true
89+
annotate: false
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
if: always()
93+
failed-reports-test:
94+
needs: build-and-test
95+
runs-on: ubuntu-latest
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v4
99+
- name: Failed Test Reports
100+
uses: ./
101+
with:
102+
report-path: './ctrf-reports/ctrf-report.json'
103+
failed-report: true
104+
failed-folded-report: true
105+
annotate: false
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
if: always()
109+
flaky-reports-test:
110+
needs: build-and-test
111+
runs-on: ubuntu-latest
112+
steps:
113+
- name: Checkout code
114+
uses: actions/checkout@v4
115+
- name: Flaky Test Reports
116+
uses: ./
117+
with:
118+
report-path: './ctrf-reports/ctrf-report.json'
119+
flaky-report: true
120+
annotate: false
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
if: always()
124+
ai-reports-test:
125+
needs: build-and-test
126+
runs-on: ubuntu-latest
127+
steps:
128+
- name: Checkout code
129+
uses: actions/checkout@v4
130+
- name: AI Test Reports
131+
uses: ./
132+
with:
133+
report-path: './ctrf-reports/ctrf-report.json'
134+
ai-report: true
135+
annotate: false
136+
if: always()
137+
skipped-reports-test:
138+
needs: build-and-test
139+
runs-on: ubuntu-latest
140+
steps:
141+
- name: Checkout code
142+
uses: actions/checkout@v4
143+
- name: Skipped Test Reports
144+
uses: ./
145+
with:
146+
report-path: './ctrf-reports/ctrf-report.json'
147+
skipped-report: true
148+
annotate: false
149+
if: always()
150+
suite-reports-test:
151+
needs: build-and-test
152+
runs-on: ubuntu-latest
153+
steps:
154+
- name: Checkout code
155+
uses: actions/checkout@v4
156+
- name: Suite Test Reports
157+
uses: ./
158+
with:
159+
report-path: './ctrf-reports/ctrf-report.json'
160+
suite-list-report: true
161+
suite-folded-report: true
162+
annotate: false
163+
if: always()
164+
commit-reports-test:
165+
needs: build-and-test
166+
runs-on: ubuntu-latest
167+
steps:
168+
- name: Checkout code
169+
uses: actions/checkout@v4
170+
- name: Commit Test Reports
171+
uses: ./
172+
with:
173+
report-path: './ctrf-reports/ctrf-report.json'
174+
commit-report: true
175+
annotate: false
176+
if: always()
177+
custom-reports-test:
178+
needs: build-and-test
179+
runs-on: ubuntu-latest
180+
steps:
181+
- name: Checkout code
182+
uses: actions/checkout@v4
183+
- name: Custom Test Reports
184+
uses: ./
185+
with:
186+
report-path: './ctrf-reports/ctrf-report.json'
187+
custom-report: true
188+
template-path: './templates/custom-report.hbs'
189+
annotate: false
190+
if: always()
191+
community-reports-test:
192+
needs: build-and-test
193+
runs-on: ubuntu-latest
194+
steps:
195+
- name: Checkout code
196+
uses: actions/checkout@v4
197+
- name: Community Test Reports
198+
uses: ./
199+
with:
200+
report-path: './ctrf-reports/ctrf-report.json'
201+
community-report: true
202+
community-report-name: 'summary-short'
203+
annotate: false
204+
if: always()
205+
previous-reports-test:
206+
needs: build-and-test
207+
runs-on: ubuntu-latest
208+
steps:
209+
- name: Checkout code
210+
uses: actions/checkout@v4
211+
- name: Install dependencies
212+
run: npm install
213+
- name: Modify reports
214+
run: npm run modify-reports
215+
- name: Reports Requiring Previous
216+
uses: ./
217+
with:
218+
report-path: './ctrf-reports/*.json'
219+
previous-results-report: true
220+
flaky-rate-report: true
221+
fail-rate-report: true
222+
insights-report: true
223+
slowest-report: true
224+
annotate: false
225+
env:
226+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
227+
if: always()
228+
report-order-test:
229+
needs: build-and-test
230+
runs-on: ubuntu-latest
231+
steps:
232+
- name: Checkout code
233+
uses: actions/checkout@v4
234+
- name: Install dependencies
235+
run: npm install
236+
- name: Modify reports
237+
run: npm run modify-reports
238+
- name: Custom Report Order
239+
uses: ./
240+
with:
241+
report-path: './ctrf-reports/*.json'
242+
summary-report: true
243+
failed-report: true
244+
flaky-report: true
245+
report-order: 'flaky-report,failed-report,summary-report'
246+
annotate: false
247+
env:
248+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
249+
if: always()
250+
junit-to-ctrf-test:
251+
needs: build-and-test
252+
runs-on: ubuntu-latest
253+
steps:
254+
- name: Checkout code
255+
uses: actions/checkout@v4
256+
- name: Install dependencies
257+
run: npm install
258+
- name: Modify reports
259+
run: npm run modify-reports
260+
- name: JUnit to CTRF integration test
261+
uses: ./
262+
with:
263+
report-path: './ctrf-reports/*.xml'
264+
integrations-config: |
265+
{
266+
"junit-to-ctrf": {
267+
"enabled": true,
268+
"action": "convert",
269+
"options": {
270+
"output": "./ctrf-reports/ctrf-report.json",
271+
"toolname": "junit-to-ctrf",
272+
"useSuiteName": false,
273+
"env": {
274+
"appName": "my-app"
275+
}
276+
}
277+
}
278+
}
279+
annotate: false
280+
env:
281+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
282+
if: always()
283+
npx-cli-test:
284+
runs-on: ubuntu-latest
285+
needs: build-and-test
286+
steps:
287+
- name: Checkout code
288+
uses: actions/checkout@v4
289+
- name: Install dependencies
290+
run: npm install
291+
- name: Build
292+
run: npm run build:npm
293+
- name: Modify reports
294+
run: npm run modify-reports
295+
- name: Default tables
296+
run: node dist/core/cli.js ctrf-reports/ctrf-report.json --title "Default tables" --annotate false

0 commit comments

Comments
 (0)