Skip to content

Commit b2da5c3

Browse files
committed
Add GitHub action to run tests
1 parent 855e8f6 commit b2da5c3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/test.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Use Node.js
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version-file: '.nvmrc'
16+
- name: Get npm cache directory
17+
id: npm-cache-dir
18+
run: |
19+
echo "::set-output name=dir::$(npm config get cache)"
20+
- uses: actions/cache@v3
21+
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
22+
with:
23+
path: ${{ steps.npm-cache-dir.outputs.dir }}
24+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-node-
27+
- run: npm ci
28+
- run: npm test

0 commit comments

Comments
 (0)