-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (71 loc) · 2.34 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: GitHub CI
on:
pull_request:
branches:
- '*'
push:
branches:
- master
jobs:
validate-and-test:
name: Validate and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# macOS-latest
env:
ELECTRON_CACHE: $HOME/.cache/electron
ELECTRON_BUILDER_CACHE: $HOME/.cache/electron-builder
steps:
- name: Retrieves project from the git branch
uses: actions/checkout@v1
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Setup node ${{ steps.nvm.outputs.NVMRC }}
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- run: node --version; npm --version; yarn --version
- name: Cache node modules
id: cache
uses: actions/cache@v2
with:
path: node_modules
## Check cache based on yarn.lock hashfile
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
## If no cache is found, install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: yarn validate
run: yarn validate
- name: yarn test:coverage
run: yarn test:coverage --maxWorkers=2
- name: CodeCov
uses: codecov/codecov-action@v1
standalone-build:
name: Standalone Build
runs-on: ubuntu-latest
steps:
- name: Retrieves project from the git branch
uses: actions/checkout@v1
- name: Retrieve node version from .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat package.json | grep '\"node\":' | sed 's/^ *//;s/ *$//;s/\"node\":\ \"//;s/\",//')"
id: nvm
- name: Setup node ${{ steps.nvm.outputs.NVMRC }}
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: yarn build
run: yarn build
- name: Zip standalone build folder
run: zip -r dist/web/standalone_pyrus.zip dist/web/
- name: 'Save standalone_pyrus.zip to artifacts'
uses: actions/upload-artifact@v1
with:
name: 'standalone_pyrus'
path: 'dist/web/standalone_pyrus.zip'