-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (114 loc) · 3.6 KB
/
ci.yml
File metadata and controls
137 lines (114 loc) · 3.6 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
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
name: CI
"on":
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
NEXT_TELEMETRY_DISABLED: "1"
jobs:
lint:
name: Lint (Biome + ESLint)
runs-on: ${{ fromJSON(vars.ACTIONS_RUNNER_LABELS || '["ubuntu-latest"]') }}
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 1
- name: Setup
uses: ./.github/actions/ci-setup
- name: Lint
run: bun run lint
typecheck:
name: Typecheck
runs-on: ${{ fromJSON(vars.ACTIONS_RUNNER_LABELS || '["ubuntu-latest"]') }}
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 1
- name: Setup
uses: ./.github/actions/ci-setup
- name: Typecheck
run: bun run typecheck
test:
name: Test (Vitest, Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
runs-on: ${{ fromJSON(vars.ACTIONS_RUNNER_LABELS || '["ubuntu-latest"]') }}
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 1
- name: Setup
uses: ./.github/actions/ci-setup
- name: Test
env:
VITEST_SHARD_INDEX: ${{ matrix.shardIndex }}
VITEST_SHARD_COUNT: ${{ matrix.shardTotal }}
run: bun run test:ci:shard
- name: Upload blob report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v6.0.0
with:
name: blob-report-${{ matrix.shardIndex }}
path: .vitest-reports/blob/${{ matrix.shardIndex }}.json
include-hidden-files: true
retention-days: 7
test-merge:
name: Test (Vitest, Merge Reports)
runs-on: ${{ fromJSON(vars.ACTIONS_RUNNER_LABELS || '["ubuntu-latest"]') }}
needs: ["test"]
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 1
- name: Setup
uses: ./.github/actions/ci-setup
- name: Download blob reports
uses: actions/download-artifact@v7.0.0
with:
pattern: blob-report-*
path: .vitest-reports/blob
merge-multiple: true
- name: Merge reports
run: bun run test:ci:merge
- name: Upload JUnit report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v6.0.0
with:
name: vitest-junit
path: .vitest-reports/junit.xml
retention-days: 14
build:
name: Build (Next.js)
runs-on: ${{ fromJSON(vars.ACTIONS_RUNNER_LABELS || '["ubuntu-latest"]') }}
needs: ["lint", "typecheck", "test-merge"]
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 1
- name: Setup
uses: ./.github/actions/ci-setup
- name: Cache Next.js build cache
uses: actions/cache@v5.0.3
with:
path: |
${{ github.workspace }}/.next/cache
key: nextcache-${{ runner.os }}-${{ hashFiles('bun.lock', 'package.json', 'tsconfig.json', 'postcss.config.mjs', 'next.config.ts', 'src/**/*.ts', 'src/**/*.tsx', 'src/**/*.js', 'src/**/*.jsx') }}
restore-keys: |
nextcache-${{ runner.os }}-${{ hashFiles('bun.lock', 'package.json', 'tsconfig.json', 'postcss.config.mjs', 'next.config.ts') }}-
nextcache-${{ runner.os }}-
- name: Build
run: bun run build