-
Notifications
You must be signed in to change notification settings - Fork 97
57 lines (46 loc) · 1.45 KB
/
run-tests.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
name: "Run tests"
on:
workflow_call:
jobs:
run-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["16", "18", "20"]
os: ["ubuntu-latest"]
name: "node ${{ matrix.node }} / ${{ matrix.os }}"
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
# See: https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Get pnpm store directory
shell: bash
id: pnpm-store-path
run: |
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
# See: https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-store-path.outputs.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install
# build before testing as some tests actually test the build
- name: Build
run: pnpm build
- name: Lint
run: pnpm lint
- name: Run tests
run: pnpm test
- name: Run dist tests
run: pnpm test:dist