-
Notifications
You must be signed in to change notification settings - Fork 9
80 lines (79 loc) · 2.38 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- master
jobs:
unit-test-rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- uses: Swatinem/rust-cache@v2
- name: install additional targets
run: rustup target add wasm32-wasi
- name: test
run: cargo test
- name: lint
run: cargo clippy
# currently `cargo wasi test` doesn't run, so ensure at least that it builds
- name: build (wasi)
run: cargo build --target wasm32-wasi
unit-test-js:
runs-on: ubuntu-latest
name: unit-test-js (Node ${{ matrix.node-version }})
strategy:
matrix:
node-version: [18.18, 18, 20.5, 20, 22]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run check --workspaces --if-present
- run: npm test --workspaces --if-present
e2e-test:
runs-on: ubuntu-latest
strategy:
matrix:
# 20.5 is added because @nitrogql/esbuild-register behaves differently
# before and after 20.6
# 18.18 is added for the same reason
node-version: [18.18, 18, 20.5, 20, 22]
name: e2e-test (Node ${{ matrix.node-version }})
steps:
- uses: actions/checkout@v3
- name: install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- uses: Swatinem/rust-cache@v2
- name: install additional targets
run: rustup target add wasm32-wasi wasm32-unknown-unknown
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: build rust
run: ./build/build-rust.sh
- name: build node
run: ./build/build-node.sh
- name: run e2e tests
run: npm run e2e-test --workspace ./e2e-tests
- name: run nitrogql in nextjs example
run: |
npm run generate
npm run build
working-directory: examples/nextjs
- name: run nitrogql in vite example
run: |
npm run generate
npm run build
working-directory: examples/vite