-
-
Notifications
You must be signed in to change notification settings - Fork 41
83 lines (80 loc) · 2.48 KB
/
nodejs.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: nodejs
on:
pull_request:
branches:
- master
push:
branches:
- master
# Add to every job
# - uses: actions/cache@v1
# id: nodejs-cache
# name: Cache node modules
# with:
# path: node_modules
# key: ${{ matrix.os }}-nodejs-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
# restore-keys: |
# ${{ matrix.os }}-nodejs-${{ matrix.node }}-
# ${{ matrix.os }}-nodejs-
# ${{ matrix.os }}-
jobs:
lint:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
env:
CI: true
strategy:
matrix:
os: [ubuntu-latest]
node: [12.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
if: steps.nodejs-cache.outputs.cache-hit != 'true'
- uses: actions/cache@v1
id: nodejs-cache
name: Cache node modules
with:
path: node_modules
key: ${{ matrix.os }}-nodejs-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ matrix.os }}-nodejs-${{ matrix.node }}-
${{ matrix.os }}-nodejs-
${{ matrix.os }}-
- name: Installing dependencies
if: steps.nodejs-cache.outputs.cache-hit != 'true'
run: yarn run setup:ci
- name: Linting & Format with Hela ESLint
run: yarn run lint
- name: Format full codebase with Prettier
run: yarn run format
test:
if: "!contains(toJson(github.event.commits), '[skip ci]')"
env:
CI: true
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [10.x, 12.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
if: steps.nodejs-cache.outputs.cache-hit != 'true'
- uses: actions/cache@v1
id: nodejs-cache
name: Cache node modules
with:
path: node_modules
key: ${{ matrix.os }}-nodejs-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ matrix.os }}-nodejs-${{ matrix.node }}-
${{ matrix.os }}-nodejs-
${{ matrix.os }}-
- name: Installing dependencies
if: steps.nodejs-cache.outputs.cache-hit != 'true'
run: yarn run setup:ci
- name: Testing
run: yarn run test:ci
- name: Sending coverage to CodeCov
if: matrix.os == 'ubuntu-latest' && matrix.node == '12.x'
run: echo ${{ matrix.node }} && bash <(curl -s https://codecov.io/bash)