forked from electron/forge
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (171 loc) · 5.72 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: CI
on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
jobs:
dependabolt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run dependabolt
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'dependabot/')
uses: docker://ghcr.io/malept/dependabolt-action:2.1.3
env:
DEPENDABOLT_SSH_DEPLOY_KEY: ${{ secrets.DEPENDABOLT_SSH_DEPLOY_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
fast-tests:
runs-on: ${{ matrix.os }}
needs: dependabolt
strategy:
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
steps:
- name: Fix git checkout line endings
run: git config --global core.autocrlf input
- uses: actions/checkout@v2
- name: Use Node.js 10.x
uses: actions/[email protected]
with:
node-version: 10.x
- name: Determine Yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install bolt
shell: bash
run: |
case "$(uname -s)" in
Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;;
*) BOLT_VERSION=latest ;;
esac
npm install -g bolt@$BOLT_VERSION
- name: Install
run: bolt
- name: Lint
run: bolt lint
- name: Build
run: bolt build
- name: Run tests
run: bolt coverage:fast
- name: Upload code coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.lcov
env_vars: CI_OS,TEST_TYPE
env:
CI_OS: ${{ matrix.os }}
TEST_TYPE: fast
slow-tests:
runs-on: ${{ matrix.os }}
needs: dependabolt
strategy:
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
steps:
- name: Fix git checkout line endings
run: git config --global core.autocrlf input
- uses: actions/checkout@v2
- name: Windows specific setup
if: matrix.os == 'windows-latest'
run: |
C:\ProgramData\chocolatey\lib\wixtoolset\tools\wix311.exe /install /quiet /norestart
npm config set node-gyp "$($env:GITHUB_WORKSPACE)\node_modules\node-gyp\bin\node-gyp.js"
- name: Linux specific setup
if: matrix.os == 'ubuntu-latest'
run: |
sudo add-apt-repository -y ppa:alexlarsson/flatpak
sudo rm /etc/apt/sources.list.d/bazel.list
sudo rm /etc/apt/sources.list.d/mongo*.list
grep -l opensuse /etc/apt/sources.list.d/* | xargs sudo rm
sudo apt-get update
sudo apt-get install -y --no-install-recommends snapcraft flatpak-builder elfutils
ci/install_runtimes.sh
- name: Use Node.js 10.x
uses: actions/[email protected]
with:
node-version: 10.x
- name: Determine Yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install bolt
shell: bash
run: |
case "$(uname -s)" in
Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;;
*) BOLT_VERSION=latest ;;
esac
npm install -g bolt@$BOLT_VERSION
- name: Install
run: bolt
- name: Test on Windows
if: matrix.os == 'windows-latest'
run: |
$wixToolsetBinPath = ";C:\Program Files (x86)\WiX Toolset v3.11\bin;"
$env:PATH = $env:PATH + $wixToolsetBinPath
[Environment]::SetEnvironmentVariable("Path", $env:PATH, [EnvironmentVariableTarget]::Machine)
if ((Get-Command "light.exe" -ErrorAction SilentlyContinue) -eq $null)
{
Write-Host "Unable to find light.exe in your PATH"
}
bolt coverage:slow
- name: Test on macOS/Linux
if: matrix.os != 'windows-latest'
run: bolt coverage:slow
env:
DEBUG: electron-installer-snap:snapcraft
- name: Upload code coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.lcov
env_vars: CI_OS,TEST_TYPE
env:
CI_OS: ${{ matrix.os }}
TEST_TYPE: slow
# docs:
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# needs: [fast-tests, slow-tests]
# runs-on: [ubuntu-latest]
# steps:
# - uses: actions/checkout@v1
# - name: Use Node.js 12.x
# uses: actions/[email protected]
# with:
# node-version: 12.x
# - name: Cache node_modules
# uses: actions/cache@v2
# with:
# path: node_modules
# key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.OS }}-build-${{ env.cache-name }}-
# ${{ runner.OS }}-build-
# ${{ runner.OS }}-
# - name: Install bolt
# shell: bash
# run: |
# case "$(uname -s)" in
# Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;;
# *) BOLT_VERSION=latest ;;
# esac
# npm install -g bolt@$BOLT_VERSION
# - name: Deploy docs
# run: ci/docs.sh
# env:
# NOW_TOKEN: ${{ secrets.NOW_TOKEN }}