Skip to content

Commit 6a9bc2f

Browse files
committed
add CI workflow
1 parent 8d26333 commit 6a9bc2f

1 file changed

Lines changed: 143 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
schedule:
10+
- cron: '0 3 * * 0' # every Sunday at 3am
11+
12+
env:
13+
CI: true
14+
15+
jobs:
16+
lint_js:
17+
name: Lint JS
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: pnpm/action-setup@v4
22+
with:
23+
version: 8
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 18
27+
cache: pnpm
28+
- name: Install Dependencies
29+
run: pnpm install --frozen-lockfile
30+
- name: ESLint
31+
run: pnpm lint
32+
33+
test_type_checking:
34+
name: 'Tests: Type Check'
35+
timeout-minutes: 5
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: pnpm/action-setup@v4
41+
with:
42+
version: 8
43+
- uses: actions/setup-node@v4
44+
with:
45+
node-version: 18
46+
cache: pnpm
47+
- name: Install Dependencies
48+
run: pnpm install --frozen-lockfile
49+
- run: pnpm tsc --noEmit
50+
working-directory: tests
51+
52+
tests:
53+
name: Tests
54+
timeout-minutes: 5
55+
runs-on: ubuntu-latest
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
# how to say "not these" so we don't miss anything?
60+
# waiting on a an api from vitest for querying
61+
# the list of tests ahead of time before running them.
62+
#
63+
# https://github.com/vitest-dev/vitest/issues/2901
64+
#
65+
# It would be great if vitest had a flag to give us the JSON of all the tests,
66+
# so we could be sure we don't miss anything
67+
# and then generate this list from a previous C.I. job
68+
slow-test:
69+
# flags
70+
- addon-location
71+
- test-app-location
72+
- addon-only
73+
74+
# existing monorepo
75+
- monorepo with npm
76+
- monorepo with pnpm
77+
78+
# build-only tests for testing if the rollup config works at all
79+
- rollup-build
80+
- declarations-configuration
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
- uses: pnpm/action-setup@v4
85+
with:
86+
version: 8
87+
- uses: actions/setup-node@v4
88+
with:
89+
node-version: 18
90+
cache: pnpm
91+
- name: Install Dependencies
92+
run: pnpm install --frozen-lockfile
93+
- run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}"
94+
working-directory: tests
95+
96+
97+
defaults_tests:
98+
name: "Slow tests: ${{ matrix.slow-test }}"
99+
timeout-minutes: 5
100+
runs-on: ubuntu-latest
101+
strategy:
102+
fail-fast: false
103+
matrix:
104+
slow-test:
105+
- defaults with npm
106+
- defaults with pnpm
107+
steps:
108+
- uses: actions/checkout@v4
109+
- uses: pnpm/action-setup@v4
110+
with:
111+
version: 8
112+
- uses: actions/setup-node@v4
113+
with:
114+
node-version: 18
115+
cache: pnpm
116+
- name: Install Dependencies
117+
run: pnpm install --frozen-lockfile
118+
- run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}"
119+
working-directory: tests
120+
121+
typescript_tests:
122+
name: "Slow tests: ${{ matrix.slow-test }}"
123+
timeout-minutes: 5
124+
runs-on: ubuntu-latest
125+
strategy:
126+
fail-fast: false
127+
matrix:
128+
slow-test:
129+
- typescript with npm
130+
- typescript with pnpm
131+
steps:
132+
- uses: actions/checkout@v4
133+
- uses: pnpm/action-setup@v4
134+
with:
135+
version: 8
136+
- uses: actions/setup-node@v4
137+
with:
138+
node-version: 18
139+
cache: pnpm
140+
- name: Install Dependencies
141+
run: pnpm install --frozen-lockfile
142+
- run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}"
143+
working-directory: tests

0 commit comments

Comments
 (0)