-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (77 loc) · 2.21 KB
/
test.yml
File metadata and controls
95 lines (77 loc) · 2.21 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
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
name: Tests
on:
push:
branches: [main, 'claude/**']
pull_request:
branches: [main]
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Run unit tests
run: bun test src/
# Integration test using the GitHub Action
test:
name: Test Worker ${{ matrix.index }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
index: [0, 1, 2]
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Split tests
id: split
uses: ./
with:
command: split
pattern: 'tests/dummy/*.test.ts'
total: 3
index: ${{ matrix.index }}
cache-key: integration-tests
- name: Show assigned tests
run: echo "Worker ${{ matrix.index }} running:${{ steps.split.outputs.tests }}"
- name: Run tests
if: steps.split.outputs.tests != ''
run: bun test ${{ steps.split.outputs.tests }} --reporter=junit --reporter-outfile=junit-${{ matrix.index }}.xml
- name: Convert JUnit to timing JSON
if: steps.split.outputs.tests != ''
uses: ./
with:
command: convert
from: junit-${{ matrix.index }}.xml
to: timing-${{ matrix.index }}.json
- name: Upload timing artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: timing-${{ matrix.index }}
path: timing-${{ matrix.index }}.json
save-timings:
name: Save Timings
needs: test
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Show downloaded artifacts
run: find . -name "*.json" -type f
- name: Merge timings
uses: ./
with:
command: merge
prefix: 'timing-*/timing-'
cache-key: integration-tests
- name: Show saved timings
run: cat .fairsplice-timings.json