-
-
Notifications
You must be signed in to change notification settings - Fork 14
85 lines (83 loc) · 2.56 KB
/
test.yml
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
checks:
timeout-minutes: 5
runs-on: ${{ matrix.os }}
strategy:
matrix:
# pseudo-matrix for convenience, NEVER use more than a single combination
node: [18]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: install pnpm
shell: bash
run: |
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
echo installing pnpm version $PNPM_VER
npm i -g pnpm@$PNPM_VER
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: install
run: |
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
- name: format
run: pnpm check:format
- name: lint
if: ${{ !cancelled() }}
run: pnpm check:lint
- name: types
if: ${{ !cancelled() }}
run: pnpm check:types
- name: publint
if: ${{ !cancelled() }}
run: pnpm check:publint
- name: generated files are up to date
if: ${{ !cancelled() }}
run: pnpm generate && [ "`git status --porcelain=v1`" == "" ]
# this is the test matrix, it runs with node18 and 20
test:
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [18]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- node: 20
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: install pnpm
shell: bash
run: |
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
echo installing pnpm version $PNPM_VER
npm i -g pnpm@$PNPM_VER
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: install
run: |
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
- name: run tests
run: pnpm test