forked from jupyterhub/configurable-http-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (84 loc) · 2.68 KB
/
test.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Useful GitHub Actions docs:
#
# - https://help.github.com/en/actions
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# - https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
# - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: Test
on:
push:
branches-ignore:
# don't double-build dependabot PRs
- dependabot/**
pull_request:
workflow_dispatch:
jobs:
# Job to run linter / autoformat
lint:
runs-on: ubuntu-20.04
steps:
# Action Repo: https://github.com/actions/checkout
- name: "Checkout repo"
uses: actions/checkout@v2
# Action Repo: https://github.com/actions/setup-node
- name: "Setup Node"
uses: actions/setup-node@v1
with:
node-version: "14"
# Action Repo: https://github.com/actions/cache
- name: "Cache node_modules"
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: "Install"
run: |
npm ci
# Run the pre-commit action
# Repo: https://github.com/pre-commit/action
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
- name: npm audit
run: |
# If this fails, run `npm audit fix`
npm audit --production --audit-level=moderate
test:
# no need to wait for lint
# needs: lint
runs-on: ubuntu-20.04
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy
strategy:
fail-fast: false # Do not cancel all jobs if one fails
matrix:
node_version:
- "10"
- "12"
- "14"
- "15"
steps:
- name: "Checkout repo"
uses: actions/checkout@v2
# Action Repo: https://github.com/actions/setup-node
- name: "Setup Node"
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
# Action Repo: https://github.com/actions/cache
- name: "Cache node_modules"
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: "Install dependencies"
run: |
npm ci
- name: "Run tests"
run: |
npm test
# Action Repo: https://github.com/codecov/codecov-action
- name: "Upload coverage to codecov"
uses: codecov/codecov-action@v1