Skip to content

Commit 76ff249

Browse files
committed
Add actions
1 parent 15ad56a commit 76ff249

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/pull_request.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Pull request
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: master
7+
8+
# This will cancel previous jobs in case of new push.
9+
concurrency:
10+
group: ${{ github.head_ref || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
audit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16.13.1
23+
24+
- name: Find yarn cache location
25+
id: yarn-cache
26+
run: echo "::set-output name=dir::$(yarn cache dir)"
27+
28+
- name: JS package cache
29+
uses: actions/cache@v3
30+
with:
31+
path: ${{ steps.yarn-cache.outputs.dir }}
32+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-yarn-
35+
36+
- name: Install packages
37+
run: yarn install --pure-lockfile
38+
39+
- name: Run audit
40+
run: yarn audit-ci
41+
42+
eslint:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v3
46+
47+
- name: Setup Node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 16.13.1
51+
52+
- name: Find yarn cache location
53+
id: yarn-cache
54+
run: echo "::set-output name=dir::$(yarn cache dir)"
55+
56+
- name: JS package cache
57+
uses: actions/cache@v3
58+
with:
59+
path: ${{ steps.yarn-cache.outputs.dir }}
60+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
61+
restore-keys: |
62+
${{ runner.os }}-yarn-
63+
64+
- name: Install packages
65+
run: yarn install --pure-lockfile
66+
67+
- name: Run linters
68+
run: yarn lint

0 commit comments

Comments
 (0)