forked from Seneca-CDOT/telescope
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (83 loc) · 2.37 KB
/
node-js-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: node-js-ci
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
# Confirm that prettier was run on the changes
prettier:
name: Prettier Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
- name: Install dependencies and run prettier-check
run: |
npm install
npm run prettier-check
# Make sure eslint passes
eslint:
name: ESLint Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
- name: Install dependencies and run eslint
run: |
npm install
npm run eslint
# Run unit tests on all platforms/versions of node
unit:
name: Unit Tests
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies and run tests with default env
run: |
npm install
npm run jest
# Run end-to-end tests along with the microservices in docker-compose on Linux
e2e:
name: End-To-End Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- uses: actions/[email protected]
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- uses: microsoft/playwright-github-action@v1
- name: Start microservices and run tests
run: |
npm install
npm run services:start
npm run jest:e2e