-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (34 loc) · 1.1 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
37
38
39
40
41
42
43
44
name: Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
cache-dependency-path: ./src/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build front-end
run: npx webpack --mode production
- name: TypeCheck front-end
run: npm run typeCheck
# See https://jestjs.io/docs/troubleshooting#tests-are-extremely-slow-on-docker-andor-continuous-integration-ci-server
- name: Get number of CPU cores
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v1
- name: Set time zone to America/Chicago
uses: szenius/[email protected]
with:
timezoneLinux: "America/Chicago"
timezoneMacos: "America/Chicago"
timezoneWindows: "America/Chicago"
- name: Run JS test suite
run: |
npm run unitTests -- --maxWorkers ${{ steps.cpu-cores.outputs.count }}