-
Notifications
You must be signed in to change notification settings - Fork 13
111 lines (102 loc) · 3.17 KB
/
Copy pathci.yml
File metadata and controls
111 lines (102 loc) · 3.17 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- name: Build
run: pnpm turbo run build --filter='!./dev/*'
lint:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- run: pnpm lint --format github
knip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- name: Run Knip
run: pnpm knip --reporter github-actions
test_shards:
name: Test (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
runs-on: ubuntu-latest
needs: build
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- name: Test (PR)
if: github.event_name == 'pull_request'
run: pnpm test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests --coverage --reporter=default --reporter=blob
- name: Test
if: github.event_name != 'pull_request'
run: pnpm test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests
- name: Upload coverage report
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v7
with:
name: blob-report-${{ github.run_id }}-${{ matrix.shardIndex }}
path: '.vitest-reports/*'
include-hidden-files: true
retention-days: 1
test:
name: test
runs-on: ubuntu-latest
needs: test_shards
if: ${{ !cancelled() }}
steps:
- name: Check test shard status
env:
RESULT: ${{ needs.test_shards.result }}
run: |
if [ "$RESULT" != "success" ]; then
echo "Test shards failed with status: $RESULT"
exit 1
fi
report_coverage:
name: Coverage report
runs-on: ubuntu-latest
needs: test_shards
if: ${{ !cancelled() && github.event_name == 'pull_request' && needs.test_shards.result == 'success' }}
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- name: Download coverage reports
uses: actions/download-artifact@v8
with:
path: .vitest-reports
pattern: blob-report-${{ github.run_id }}-*
merge-multiple: true
- name: Merge coverage reports
run: pnpm vitest run --merge-reports --coverage
- name: Report coverage
uses: davelosert/vitest-coverage-report-action@8b157684c6a6b259b97d45e72b44242865c0f6a5 # v2.12.2