This repository has been archived by the owner on Sep 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (59 loc) · 1.78 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Node CI
on:
push:
branches-ignore:
- tmp/**
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache/Restore node_modules
id: cache-dependencies
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: Get yarn cache dir
if: steps.cache-dependencies.outputs.cache-hit != 'true'
id: cache-yarn
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache/Restore yarn cache
if: steps.cache-dependencies.outputs.cache-hit != 'true'
uses: actions/cache@v1
with:
path: ${{ steps.cache-yarn.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ matrix.node-version }}-
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
yarn
- name: Print dependencies
run: |
echo -n "node " && node -v
echo -n "npm " && npm -v
yarn list --depth=0
- name: yarn lint
run: |
yarn lint
- name: yarn test
run: |
yarn test
- name: Slack Notification
uses: weseek/ghaction-slack-notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: '*test (${{ matrix.node-version }})*'
channel: '#ci'
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}