-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (65 loc) · 2 KB
/
pr.yaml
File metadata and controls
80 lines (65 loc) · 2 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
name: Test
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
test:
name: Test on Node.js ${{ matrix.node }}${{ matrix.node == '22' && ', Bun,' || '' }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [18, 20, 22, 24]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Bun
if: ${{ matrix.node == '22' }}
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup RocksDB cache
uses: actions/cache@v4
with:
path: deps/rocksdb
key: ${{ runner.os }}-rocksdb-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-rocksdb-
- name: Install dependencies
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: pnpm install --ignore-scripts
- name: Lint
run: pnpm lint
- name: Build
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: pnpm build
- name: Run tests on Node.js ${{ matrix.node }}
run: pnpm coverage
- name: Run tests on Bun
if: ${{ matrix.node == '22' }}
run: bun coverage