-
Notifications
You must be signed in to change notification settings - Fork 31
37 lines (34 loc) · 1.24 KB
/
node.js.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
name: run all tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout the code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Preinstall PNPM
run: npm i -g pnpm@9.9.0
- name: Detect package manager
id: detect-package-manager
run: |
echo "manager=pnpm" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=pnpm" >> $GITHUB_OUTPUT
exit 0
- name: Install deps with package manager
run: ${{ steps.detect-package-manager.outputs.runner }} ${{ steps.detect-package-manager.outputs.command }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: ${{ steps.detect-package-manager.outputs.manager }}
- run: ${{ steps.detect-package-manager.outputs.runner }} test