This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
68 lines (57 loc) · 1.66 KB
/
ci.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
58
59
60
61
62
63
64
65
66
67
68
on:
pull_request:
branches:
- main
push:
branches:
- main
name: CI Checks
jobs:
code_checks:
name: Typescript, ESLint, Prettier, Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 5
env:
TEST_RELAY_URL: ${{ secrets.TEST_RELAY_URL }}
TEST_PROJECT_ID: ${{ secrets.TEST_PROJECT_ID }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Check npm cache
uses: actions/cache@v2
id: cache-npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Check node_modules cache
id: cache-node-modules
uses: actions/cache@v2
env:
TEST_RELAY_URL: ${{ secrets.TEST_RELAY_URL }}
TEST_PROJECT_ID: ${{ secrets.TEST_PROJECT_ID }}
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-nodemodules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodemodules-
- name: Install NPM Dependencies
run: npm install
- name: Prettier
run: npm run prettier
- name: ESLint
run: npm run lint
- name: Build
run: npm run build
- name: Unit Tests
run: npm run test