-
Notifications
You must be signed in to change notification settings - Fork 131
55 lines (52 loc) · 1.45 KB
/
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
48
49
50
51
52
53
54
55
name: Unit Tests
on:
push:
branches:
- master
- bso
pull_request:
jobs:
test:
name: Node v${{ matrix.node_version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [18.12.0, 20]
os: [ubuntu-latest]
steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- name: Restore CI Cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles(matrix.os == 'windows-latest' && '**\yarn.lock' || '**/yarn.lock') }}
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Copy Configuration
run: |
pushd src &&
cp config.example.ts config.ts &&
popd
- name: Copy env
run: cp .env.example .env
- name: Generate Prisma Client
run: yarn gen
- name: Run ESLint on changed files
uses: tj-actions/eslint-changed-files@v21
with:
skip_annotations: true
config_path: ".eslintrc.json"
ignore_path: ".eslintignore"
file_extensions: |
**/*.ts
**/*.tsx
- name: Build
run: yarn build
- name: Test
run: yarn test:unit