Skip to content

Commit 7b46a4f

Browse files
committed
Add worlflow for testing
1 parent 2dc65f7 commit 7b46a4f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/test.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# https://github.com/marketplace/actions/run-jest
2+
name: test
3+
on:
4+
push:
5+
branches_ignore:
6+
- master
7+
jobs:
8+
9+
jest:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [14.x]
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
24+
# https://docs.github.com/ja/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows
25+
- name: Cache node modules
26+
uses: actions/cache@v2
27+
env:
28+
cache-name: cache-node-modules
29+
with:
30+
# npm キャッシュファイルは Linux/macOS の「~/.npm」に保存される
31+
path: ~/.npm
32+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-build-${{ env.cache-name }}-
35+
${{ runner.os }}-build-
36+
37+
- name: Install modules
38+
run: npm install
39+
40+
- name: Run tests
41+
run: npm run test

0 commit comments

Comments
 (0)