Skip to content

Commit 8f7c23a

Browse files
authored
ci(actions): run jest unit tests on PR (#63)
1 parent 2d1f57e commit 8f7c23a

File tree

3 files changed

+27830
-8840
lines changed

3 files changed

+27830
-8840
lines changed

.github/workflows/unit-tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Jest
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
name: unit tests
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: "14"
19+
20+
# Speed up subsequent runs with caching
21+
- name: Cache node modules
22+
uses: actions/cache@v2
23+
env:
24+
cache-name: cache-node-modules
25+
with:
26+
# npm cache files are stored in `~/.npm` on Linux/macOS
27+
path: ~/.npm
28+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-build-${{ env.cache-name }}-
31+
${{ runner.os }}-build-
32+
${{ runner.os }}-
33+
# Install required deps for action
34+
- name: Install dependencies
35+
run: npm install
36+
37+
# Finally, run our tests
38+
- name: Run the tests
39+
run: npm test

0 commit comments

Comments
 (0)