forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
210 lines (179 loc) · 6.5 KB
/
ci.yml
File metadata and controls
210 lines (179 loc) · 6.5 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
#/
# @license Apache-2.0
#
# Copyright (c) 2019 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#/
# Workflow name:
name: CI
# Workflow triggers:
on:
push:
branches:
- develop
- master
# Workflow jobs:
jobs:
# Define a workflow for running continuous integration (CI) build tasks on Linux and MacOS...
ci_linux_macos:
# Define a display name:
name: "${{ matrix.BUILD_TASK }}: NODE_VERSION=${{ matrix.NODE_VERSION }}, OS=${{ matrix.OS }}"
# Define the type of virtual host machine on which to run the job:
runs-on: ${{ matrix.OS }}
# Define the build matrix strategy...
strategy:
# Specify whether to cancel all in-progress jobs if any matrix job fails:
fail-fast: true
# Define the build matrix:
matrix:
# Define the list of build tasks:
BUILD_TASK: ['test-npm-install', 'test', 'benchmark', 'examples', 'test-coverage']
# Define the list of Node.js versions on which to run this job:
NODE_VERSION: ['12', '10', '8', '6', '4', '0.12', '0.10']
# Define the list of operating systems on which to run this job:
OS: ['ubuntu-latest', 'macOS-latest']
# Define configuration options for each Node.js version:
include:
- OS: 'ubuntu-latest'
PLATFORM: 'linux'
- OS: 'macOS-latest'
PLATFORM: 'macos'
- NODE_VERSION: '12'
NPM_VERSION: '>2.7.0'
- NODE_VERSION: '10'
NPM_VERSION: '>2.7.0'
- NODE_VERSION: '8'
NPM_VERSION: '>2.7.0'
- NODE_VERSION: '6'
NPM_VERSION: '>2.7.0'
- NODE_VERSION: '4'
NPM_VERSION: '>2.7.0 <6.0.0'
- NODE_VERSION: '0.12'
NPM_VERSION: '>2.7.0 <4.0.0'
- NODE_VERSION: '0.10'
NPM_VERSION: '>2.7.0 <4.0.0'
# Define the sequence of job steps...
steps:
# Install system packages:
- name: 'Install system packages'
shell: bash
run: |
if [[ ${{ matrix.PLATFORM }} = "linux" ]]; then
sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
sudo -E apt-get update -q
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-downgrades --allow-remove-essential --allow-change-held-packages install binutils gcc-9 gcc-9-multilib g++-9 g++-9-multilib gfortran-9 gfortran-9-multilib xvfb
mkdir -p $HOME/bin
echo ::add-path::$HOME/bin
ln -s /usr/bin/gcc-9 $HOME/bin/gcc
ln -s /usr/bin/g++-9 $HOME/bin/g++
ln -s /usr/bin/gfortran-9 $HOME/bin/gfortran
else
brew update
brew install -v gcc
fi
timeout-minutes: 10
# Set environment variables:
- name: 'Set environment variables'
shell: bash
run: |
echo ::set-env name=FC::gfortran
echo ::set-env name=FORTRAN_COMPILER::gfortran
echo ::set-env name=CC::gcc
echo ::set-env name=C_COMPILER::gcc
echo ::set-env name=CXX::g++
echo ::set-env name=CXX_COMPILER::g++
echo ::set-env name=LINKER::g++
echo ::set-env name=GITHUB::true
timeout-minutes: 1
# Configure the virtual display server (needed for electron):
- name: 'Configure virtual display server'
shell: bash
run: |
export DISPLAY=':99.0'
echo ::set-env name=DISPLAY::':99.0'
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
timeout-minutes: 2
# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.NODE_VERSION }}
timeout-minutes: 5
# Print debug info:
- name: 'Print debug info'
shell: bash
run: |
echo 'PATH:'
echo $PATH
echo ''
echo 'gcc:'
gcc --version
echo ''
echo 'g++:'
g++ --version
echo ''
echo 'gfortran:'
gfortran --version
echo ''
echo 'Git:'
git --version
echo ''
echo 'Node.js:'
file $(which node)
node --version
node -p 'process.platform + "@" + process.arch'
echo ''
echo 'npm:'
npm --version
npm config get registry
timeout-minutes: 2
# Update the npm client (older clients cannot handle scoped modules):
- name: 'Update npm'
shell: bash
run: |
npm install -g npm@"${{ matrix.NPM_VERSION }}"
npm --version
timeout-minutes: 5
# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v1
with:
# Specify whether to remove untracked files before checking out the repository:
clean: false
# Limit clone depth to the most recent 100 commits:
fetch-depth: 100
# Specify whether to download Git-LFS files:
lfs: false
timeout-minutes: 10
# Perform install sequence (accounting for spurious installation errors, such as network timeouts, which can occasionally happen when running `npm install`):
- name: 'Perform install sequence'
shell: bash
run: |
make FC=$FC FORTRAN_COMPILER=$FORTRAN_COMPILER install || make FC=$FC FORTRAN_COMPILER=$FORTRAN_COMPILER install || make FC=$FC FORTRAN_COMPILER=$FORTRAN_COMPILER install
timeout-minutes: 15
# Run the build task:
- name: 'Run build task'
shell: bash
run: |
chmod +x $GITHUB_WORKSPACE/tools/ci/github/script
"$GITHUB_WORKSPACE/tools/ci/github/script" ${{ matrix.BUILD_TASK }}
timeout-minutes: 360
# View the log file if the previous step fails:
- name: 'View log file'
if: failure()
shell: bash
run: |
chmod +x $GITHUB_WORKSPACE/tools/ci/github/on_failure
"$GITHUB_WORKSPACE/tools/ci/github/on_failure"
timeout-minutes: 5