-
-
Notifications
You must be signed in to change notification settings - Fork 34
47 lines (40 loc) · 1.28 KB
/
run-unit-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
name: Run Unit Tests
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
run_unit:
name: Run Unit Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [20.x]
env:
NX_BRANCH: ${{ github.event.number }}
NX_RUN_GROUP: ${{ github.run_id }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: NPM cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache NPM
uses: actions/cache@v3
env:
cache-name: npm
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ matrix.os }}-node-${{ matrix.node-version }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ matrix.os }}-node-${{ matrix.node-version }}-${{ env.cache-name }}-
- run: npm ci
- run: npx nx affected -t test --base=origin/develop --parallel