Skip to content

Commit 6677a7e

Browse files
committed
Add test workflow
1 parent ab20ba7 commit 6677a7e

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed

.github/workflows/test.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2019 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: test
21+
22+
# Workflow triggers:
23+
on:
24+
push:
25+
branches:
26+
- develop
27+
- master
28+
paths:
29+
# Run workflow for all paths which have a `*.js` file extension:
30+
- '*.js'
31+
32+
# Except for paths within certain folders:
33+
- '!*/benchmark/*'
34+
- '!*/examples/*'
35+
- '!*/scripts/*'
36+
37+
# Except for certain top-level directories:
38+
- '!/docs/*'
39+
- '!/tools/*'
40+
41+
# Workflow jobs:
42+
jobs:
43+
44+
# Define a workflow for running unit tests...
45+
unit_tests_linux:
46+
47+
# Define a display name:
48+
name: "unit tests: ${{ matrix.OS }}"
49+
50+
# Define the type of virtual host machine on which to run the job:
51+
runs-on: ${{ matrix.OS }}
52+
53+
# Define the build matrix...
54+
strategy:
55+
matrix:
56+
# Define the list of operating systems on which to run this job:
57+
OS: [ubuntu-latest, macOS-latest]
58+
59+
# Define the list of Node.js versions on which to run this job:
60+
NODE_VERSION: ['12', '10', '8', '6', '4', '0.12', '0.10']
61+
62+
# Define configuration options for each Node.js version:
63+
include:
64+
- NODE_VERSION: '12'
65+
NPM_VERSION: '>2.7.0'
66+
67+
- NODE_VERSION: '10'
68+
NPM_VERSION: '>2.7.0'
69+
70+
- NODE_VERSION: '8'
71+
NPM_VERSION: '>2.7.0'
72+
73+
- NODE_VERSION: '6'
74+
NPM_VERSION: '>2.7.0'
75+
76+
- NODE_VERSION: '4'
77+
NPM_VERSION: '>2.7.0 <6.0.0'
78+
79+
- NODE_VERSION: '0.12'
80+
NPM_VERSION: '>2.7.0 <4.0.0'
81+
82+
- NODE_VERSION: '0.10'
83+
NPM_VERSION: '>2.7.0 <4.0.0'
84+
85+
# Define the sequence of job steps...
86+
steps:
87+
# Checkout the repository:
88+
- name: 'Checkout repository'
89+
uses: actions/checkout@v1
90+
with:
91+
# Specify whether to remove untracked files before checking out:
92+
clean: false
93+
94+
# Limit clone depth to the most recent 100 commits:
95+
fetch-depth: 100
96+
97+
# Specify whether to download Git-LFS files:
98+
lfs: false
99+
100+
# Install Node.js:
101+
- name: 'Install Node.js'
102+
uses: actions/setup-node@v1
103+
with:
104+
node-version: ${{ matrix.NODE_VERSION }}
105+
timeout-minutes: 5
106+
107+
# Update the npm client (older clients cannot handle scoped modules):
108+
- name: 'Update npm'
109+
shell: bash
110+
run: |
111+
npm install -g npm@"${{ matrix.NPM_VERSION }}"
112+
timeout-minutes: 5
113+
114+
# Print debug info:
115+
- name: 'Print debug info'
116+
run: |
117+
git --version
118+
node --version
119+
node -p 'process.platform + "@" + process.arch'
120+
npm --version
121+
npm config get registry
122+
timeout-minutes: 2

0 commit comments

Comments
 (0)