Skip to content

Commit e8a4572

Browse files
author
arek czogala
committed
chore(ci): run tests on pull request
1 parent 0ce5342 commit e8a4572

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/test_on_pr.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test Pull Request into master branch
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-20.04
11+
strategy:
12+
matrix:
13+
node-version: [12.18.0, 14.17.1]
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: Cache Node.js modules
21+
uses: actions/cache@v2
22+
with:
23+
# npm cache files are stored in `~/.npm` on Linux/macOS
24+
path: |
25+
**/node_modules
26+
key: ${{ runner.OS }}-${{ matrix.node-version }}-node-${{ hashFiles('**/package-lock.json') }}
27+
restore-keys: |
28+
${{ runner.OS }}-${{ matrix.node-version }}-node-
29+
${{ runner.OS }}-${{ matrix.node-version }}-
30+
- run:
31+
npm ci
32+
env:
33+
CI: true
34+
- run: npm run lint
35+
- run: npm run test
36+

0 commit comments

Comments
 (0)