-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (34 loc) · 1.13 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
name: Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.11.x ]
steps:
- name: Check out Git repository # clone the repo to local ci workspace
uses: actions/checkout@v3.5.3
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- name: Restore node_modules from cache
uses: actions/cache@v1.2.1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies # install project deps with --frozen-lockfile to make sure we will have the same packages version ( very recommended on running yarn install on ci)
run: yarn install --frozen-lockfile
- name: jest
run: yarn test:ci