Repository navigation
178 lines (147 loc) · 4.72 KB
/
Copy pathvalidate.yml
File metadata and controls
178 lines (147 loc) · 4.72 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: 🛡️ Validate
on:
workflow_call:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
checks:
name: Checks
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup
uses: ./.github/actions/setup
- name: Build All Packages
run: bun run buildc all
- name: Verify Generated Virtual Modules
run: |
if ! git diff --exit-code -- packages/wxt/src/internal-utils/virtual-modules.ts; then
echo "::error file=packages/wxt/src/internal-utils/virtual-modules.ts::virtual-modules.ts is out of date. Run 'bun run build' in packages/wxt (or from the root: 'bun run buildc all') and commit the updated file."
exit 1
fi
- name: Basic Checks
run: bun run check
builds:
name: Builds
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup
uses: ./.github/actions/setup
- name: Build All Packages
run: bun run buildc all
build-demo:
name: Build Demo
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup
uses: ./.github/actions/setup
- name: Build
run: bun run build:all
working-directory: packages/wxt-demo
- name: ZIP
run: bun run wxt zip
working-directory: packages/wxt-demo
linux-tests-shard:
name: Tests (Linux, ${{ matrix.shard }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
shard: [1/2, 2/2]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup
uses: ./.github/actions/setup
- name: Setup pnpm
uses: pnpm/action-setup@9bbca1e9dc2902adb87e8780fe5c98796985a62d # v6.1.1
with:
version: 10
# Every package is sharded the same way; `--passWithNoTests` covers
# packages with fewer test files than shards.
- name: Run Tests
run: bun run --workspaces test run --shard=${{ matrix.shard }} --passWithNoTests --reporter=default --reporter=hanging-process
# Required status check: passes only if every shard passed.
linux-tests:
name: Tests (Linux)
needs: linux-tests-shard
if: always()
runs-on: ubuntu-22.04
steps:
- name: Check Shard Results
run: '[ "${{ needs.linux-tests-shard.result }}" = "success" ]'
windows-tests-shard:
name: Tests (Windows, ${{ matrix.shard }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
shard: [1/3, 2/3, 3/3]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup
uses: ./.github/actions/setup
- name: Setup pnpm
uses: pnpm/action-setup@9bbca1e9dc2902adb87e8780fe5c98796985a62d # v6.1.1
with:
version: 10
- name: Run Tests
run: bun run --workspaces test run --shard=${{ matrix.shard }} --passWithNoTests
# Required status check: passes only if every shard passed.
windows-tests:
name: Tests (Windows)
needs: windows-tests-shard
if: always()
runs-on: ubuntu-22.04
steps:
- name: Check Shard Results
run: '[ "${{ needs.windows-tests-shard.result }}" = "success" ]'
template:
name: Template
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
template:
- react
- solid
- svelte
- vanilla
- vue
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup
uses: ./.github/actions/setup
with:
postinstall: 'false'
- name: Pack WXT package
run: bun pm pack
working-directory: packages/wxt
- name: Install Dependencies
run: npm i
working-directory: templates/${{ matrix.template }}
- name: Install Packed WXT
run: npm i -D ../../packages/wxt/wxt-*.tgz
working-directory: templates/${{ matrix.template }}
- name: Type Check Template
run: bun run compile
if: matrix.template != 'svelte'
working-directory: templates/${{ matrix.template }}
- name: Type Check Template
run: bun run check
if: matrix.template == 'svelte'
working-directory: templates/${{ matrix.template }}
- name: Build Template
run: bun run build
working-directory: templates/${{ matrix.template }}