6
6
- master
7
7
8
8
jobs :
9
- Test :
9
+ Build :
10
10
if : " !contains(github.event.head_commit.message, '[skip ci]')"
11
11
runs-on : ${{ matrix.os }}
12
12
strategy :
@@ -17,19 +17,13 @@ jobs:
17
17
- macos-11.0
18
18
- windows-latest
19
19
node_version :
20
- - 10
21
20
- 12
22
- - 14
23
21
node_arch :
24
22
- x64
25
23
include :
26
24
- os : windows-2016
27
25
node_version : 12
28
26
node_arch : x86
29
- - os : ubuntu-16.04
30
- node_version : 12
31
- - os : macos-10.15
32
- node_version : 12
33
27
steps :
34
28
- uses : actions/checkout@v2
35
29
50
44
# sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10
51
45
# sudo update-alternatives --config clang
52
46
# sudo update-alternatives --config clang++
53
-
47
+
54
48
# - name: Set Compiler for Ubuntu
55
49
# run: |
56
50
# echo "CC=clang" >> $GITHUB_ENV
65
59
- name : Install dependencies and build
66
60
run : npm install
67
61
68
- - name : Run tests
69
- run : npm run test
70
-
71
- - name : Run benchmarks
72
- if : ${{ !contains(matrix.node_arch, 'x86') }} # https://github.com/npm/npm-lifecycle/issues/54
73
- run : npm run benchmark
74
-
75
62
- name : Prebuildify x64
76
63
if : ${{ contains(matrix.node_version, '12') && contains(matrix.node_arch, 'x64') }}
77
64
run : npm run native:prebuild
@@ -80,23 +67,74 @@ jobs:
80
67
if : ${{ contains(matrix.node_version, '12') && contains(matrix.node_arch, 'x86') }}
81
68
run : npm run native:prebuild-ia32
82
69
83
- - name : Upload artifacts for Ubuntu
84
- if : ${{ contains(matrix.node_version, '12') && contains(matrix.os, 'ubuntu-20.04') }}
70
+ - name : Upload artifacts
85
71
86
72
with :
87
73
path : ./prebuilds
88
74
89
- - name : Upload artifacts for MacOS
90
- if : ${{ contains(matrix.node_version, '12') && contains(matrix.os, 'macos-11.0') }}
91
-
75
+ Test :
76
+ needs : Build
77
+ if : " !contains(github.event.head_commit.message, '[skip ci]')"
78
+ runs-on : ${{ matrix.os }}
79
+ strategy :
80
+ fail-fast : false
81
+ matrix :
82
+ os :
83
+ - ubuntu-20.04
84
+ - macos-11.0
85
+ - windows-latest
86
+ node_version :
87
+ - 10
88
+ - 12
89
+ - 14
90
+ node_arch :
91
+ - x64
92
+ include :
93
+ - os : windows-2016
94
+ node_version : 12
95
+ node_arch : x86
96
+ - os : ubuntu-16.04
97
+ node_version : 12
98
+ - os : macos-10.15
99
+ node_version : 12
100
+ steps :
101
+ - uses : actions/checkout@v2
102
+
103
+ - name : Cache node_modules
104
+ uses : actions/cache@v2
105
+ env :
106
+ cache-name : |
107
+ node_modules
92
108
with :
93
- path : ./prebuilds
109
+ path : node_modules
110
+ key : ${{ runner.os }}-${{ matrix.node_version }}-${{ matrix.node_arch }}-${{ hashFiles('package.json') }}
94
111
95
- - name : Upload artifacts for Windows
96
- if : ${{ contains(matrix.node_version, '12') && contains(matrix.os, 'windows-latest') }}
97
-
112
+ - name : Install Node
113
+
98
114
with :
99
- path : ./prebuilds
115
+ node-version : ${{ matrix.node_version }}
116
+ architecture : ${{ matrix.node_arch }}
117
+
118
+ - name : Install dependencies and build
119
+ run : npm install
120
+
121
+ - name : Download articats
122
+ uses : actions/download-artifact@v2
123
+
124
+ - name : Install prebuilds
125
+ shell : bash
126
+ run : |
127
+ rm -rf build
128
+ mkdir prebuilds
129
+ mv artifact/* prebuilds/
130
+ ls prebuilds
131
+
132
+ - name : Run tests
133
+ run : npm run test
134
+
135
+ - name : Run benchmarks
136
+ if : ${{ !contains(matrix.node_arch, 'x86') }} # https://github.com/npm/npm-lifecycle/issues/54
137
+ run : npm run benchmark
100
138
101
139
Skip :
102
140
if : contains(github.event.head_commit.message, '[skip ci]')
0 commit comments