forked from jtremback/minimist
-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (58 loc) · 1.97 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
##
## Continuous Integration
##
## This was intended to run for pull requests that touches `package.json` or
## the lockfile or any file under `src` directory when using the main branch as
## the base.
## Will skip pull requests that starts with "[WIP]" in their title or the ones
## that are merged already.
## This workflow aims to detect building errors, test and code coverage failures
## on pull request's changes.
##
name: CI - build and test
on:
pull_request:
branches:
- master
types: [opened, synchronize, reopened]
paths:
- 'src/**/*'
- 'package*.json'
jobs:
automated_tests:
name: 'Run tests on ${{ matrix.os }}'
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
if: >-
!startsWith(github.event.pull_request.title, '[WIP]') &&
github.event.pull_request.merged == false
env:
NODE_ENV: 'test'
steps:
##########################################################################
######################### Prepare the environment ########################
##########################################################################
- name: Checkout the repository
uses: actions/checkout@v2
- name: Use LTS version of Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install all dependencies
run: npm ci --also=dev
##########################################################################
- name: Build the project
run: npm run build
- name: Run tests
run: npm run test -- --no-browser
- name: Upload HTML coverage report
if: always()
uses: actions/upload-artifact@v2
with:
name: 'lcov-report-${{ github.event.pull_request.number }}--${{ github.event.pull_request.head.sha }}'
if-no-files-found: error
path: './coverage/lcov-report'