Skip to content

Commit 96bba4e

Browse files
committed
use separate test-report pipeline
1 parent 020c900 commit 96bba4e

2 files changed

Lines changed: 66 additions & 55 deletions

File tree

.github/workflows/ci.yml

Lines changed: 46 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,63 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
13-
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v4
1612

17-
- name: Setup Zig 0.15.1
18-
uses: goto-bus-stop/setup-zig@v2
19-
with:
20-
version: 0.15.1
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
2116

22-
- name: Setup Bun 1.3
23-
uses: oven-sh/setup-bun@v1
24-
with:
25-
bun-version: '1.3'
17+
- name: Setup Zig 0.15.1
18+
uses: goto-bus-stop/setup-zig@v2
19+
with:
20+
version: 0.15.1
2621

27-
- name: Cache Zig dependencies
28-
uses: actions/cache@v4
29-
with:
30-
path: |
31-
~/.cache/zig
32-
zig-cache
33-
key: ${{ runner.os }}-zig-${{ hashFiles('build.zig.zon') }}
34-
restore-keys: |
35-
${{ runner.os }}-zig-
22+
- name: Setup Bun 1.3
23+
uses: oven-sh/setup-bun@v1
24+
with:
25+
bun-version: "1.3"
3626

37-
- name: Cache Bun dependencies
38-
uses: actions/cache@v4
39-
with:
40-
path: |
41-
tests/node_modules
42-
~/.bun/install/cache
43-
key: ${{ runner.os }}-bun-${{ hashFiles('tests/package.json') }}
44-
restore-keys: |
45-
${{ runner.os }}-bun-
27+
- name: Cache Zig dependencies
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.cache/zig
32+
zig-cache
33+
key: ${{ runner.os }}-zig-${{ hashFiles('build.zig.zon') }}
34+
restore-keys: |
35+
${{ runner.os }}-zig-
4636
47-
- name: Install Node.js dependencies
48-
run: bun install
49-
working-directory: tests
37+
- name: Cache Bun dependencies
38+
uses: actions/cache@v4
39+
with:
40+
path: |
41+
tests/node_modules
42+
~/.bun/install/cache
43+
key: ${{ runner.os }}-bun-${{ hashFiles('tests/package.json') }}
44+
restore-keys: |
45+
${{ runner.os }}-bun-
5046
51-
- name: Build Zig project
52-
run: zig build
47+
- name: Install Node.js dependencies
48+
run: bun install
49+
working-directory: tests
5350

54-
- name: Run tests
55-
run: bun test --reporter=junit --reporter-outfile=test-results.xml
56-
working-directory: tests
51+
- name: Build Zig project
52+
run: zig build
5753

58-
- name: Upload test results
59-
uses: actions/upload-artifact@v4
60-
if: always()
61-
with:
62-
name: test-results
63-
path: tests/test-results.xml
64-
retention-days: 30
54+
- name: Run tests
55+
run: bun test --reporter=junit --reporter-outfile=test-results.xml
56+
working-directory: tests
6557

66-
- name: Publish test results
67-
uses: dorny/test-reporter@v2
68-
if: always()
69-
with:
70-
name: 'Test Results'
71-
path: 'tests/test-results.xml'
72-
reporter: 'java-junit'
73-
fail-on-error: true
58+
- name: Upload test results
59+
uses: actions/upload-artifact@v4
60+
if: always()
61+
with:
62+
name: test-results
63+
path: tests/test-results.xml
64+
retention-days: 30

.github/workflows/test-report.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Test Report"
2+
on:
3+
workflow_run:
4+
workflows: ["CI"]
5+
types:
6+
- completed
7+
permissions:
8+
contents: read
9+
actions: read
10+
checks: write
11+
jobs:
12+
report:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: dorny/test-reporter@v2
16+
with:
17+
artifact: test-results # artifact name
18+
name: Tests
19+
path: "*.xml" # Path to test results (inside artifact .zip)
20+
reporter: jest-junit # Format of test results

0 commit comments

Comments
 (0)