Skip to content

Commit a4d37b8

Browse files
committed
Add Node 17 to the build matrix
Modify the build matrix to add Node 17 to the environments under test. The GCC setup from Node 16 is reused here. As a workaround for a bug caused by Node 17 switching to OpenSSL 3, we add the `--openssl-legacy-provider` option to the `NODE_OPTIONS` environment variable. See [this node issue][node] and [this webpack issue][webpack] for details. [node]: nodejs/node#40455 [webpack]: webpack/webpack#14532
1 parent 67d7fc1 commit a4d37b8

File tree

3 files changed

+127
-9
lines changed

3 files changed

+127
-9
lines changed

.semaphore/semaphore.yml

+103-2
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ blocks:
6262
- name: Git Lint (Lintje)
6363
commands:
6464
- script/lint_git
65-
- name: Node.js 16 - Build
65+
- name: Node.js 17 - Build
6666
dependencies:
6767
- Validation
6868
task:
6969
env_vars:
70+
- name: NODE_OPTIONS
71+
value: "--openssl-legacy-provider"
7072
- name: NODE_VERSION
71-
value: '16'
73+
value: '17'
7274
prologue:
7375
commands:
7476
- sem-version c 8
@@ -86,6 +88,105 @@ blocks:
8688
- cache store $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION packages
8789
- cache store $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
8890
/tmp/appsignal-*-install.report
91+
- name: Node.js 17 - Tests
92+
dependencies:
93+
- Node.js 17 - Build
94+
task:
95+
env_vars:
96+
- name: NODE_VERSION
97+
value: '17'
98+
- name: _APPSIGNAL_EXTENSION_INSTALL
99+
value: 'false'
100+
prologue:
101+
commands:
102+
- sem-version c 8
103+
- cache restore
104+
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
105+
- cache restore $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
106+
- mono bootstrap --ci
107+
epilogue: *1
108+
jobs:
109+
- name: "@appsignal/nodejs - nodejs"
110+
commands:
111+
- mono test --package=@appsignal/nodejs
112+
- name: "@appsignal/nodejs - nodejs - diagnose"
113+
commands:
114+
- git submodule init
115+
- git submodule update
116+
- LANGUAGE=nodejs test/integration/diagnose/bin/test
117+
- name: "@appsignal/nodejs-ext - nodejs-ext"
118+
commands:
119+
- mono test --package=@appsignal/nodejs-ext
120+
- mono run --package @appsignal/nodejs-ext -- npm run test:failure
121+
- name: "@appsignal/apollo-server - apollo-server@latest - integrations"
122+
commands:
123+
- script/install_test_example_packages apollo-server apollo-server-plugin-base@latest
124+
- script/test_package_integration apollo-server
125+
- name: "@appsignal/apollo-server - [email protected] - integrations"
126+
commands:
127+
- script/install_test_example_packages apollo-server [email protected]
128+
- script/test_package_integration apollo-server
129+
- name: "@appsignal/apollo-server - [email protected] - integrations"
130+
commands:
131+
- script/install_test_example_packages apollo-server [email protected]
132+
- script/test_package_integration apollo-server
133+
- name: "@appsignal/apollo-server - [email protected] - integrations"
134+
commands:
135+
- script/install_test_example_packages apollo-server [email protected]
136+
- script/test_package_integration apollo-server
137+
- name: "@appsignal/express - express@latest - integrations"
138+
commands:
139+
- script/install_test_example_packages express express@latest
140+
- script/test_package_integration express
141+
- name: "@appsignal/express - [email protected] - integrations"
142+
commands:
143+
- script/install_test_example_packages express [email protected]
144+
- script/test_package_integration express
145+
- name: "@appsignal/koa - koa@latest - integrations"
146+
commands:
147+
- script/install_test_example_packages koa koa@latest
148+
- script/test_package_integration koa
149+
- name: "@appsignal/koa - [email protected] - integrations"
150+
commands:
151+
- script/install_test_example_packages koa [email protected]
152+
- script/test_package_integration koa
153+
- name: "@appsignal/koa - [email protected] - integrations"
154+
commands:
155+
- script/install_test_example_packages koa [email protected]
156+
- script/test_package_integration koa
157+
- name: "@appsignal/nextjs - next.js@latest - integrations"
158+
commands:
159+
- script/install_test_example_packages nextjs next@latest react@latest react-dom@latest
160+
- script/test_package_integration nextjs
161+
- name: "@appsignal/nextjs - [email protected] - integrations"
162+
commands:
163+
- script/install_test_example_packages nextjs [email protected] [email protected] [email protected]
164+
- script/test_package_integration nextjs
165+
- name: "@appsignal/nextjs - [email protected] - integrations"
166+
commands:
167+
- script/install_test_example_packages nextjs [email protected] [email protected] [email protected]
168+
- script/test_package_integration nextjs
169+
- name: Node.js 16 - Build
170+
dependencies:
171+
- Validation
172+
task:
173+
env_vars:
174+
- name: NODE_VERSION
175+
value: '16'
176+
prologue:
177+
commands:
178+
- sem-version c 8
179+
- cache restore
180+
- mono bootstrap --ci
181+
- cache store
182+
epilogue: *1
183+
jobs:
184+
- name: Build
185+
commands:
186+
- mono build
187+
- cache store $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION packages
188+
- cache store $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
189+
/tmp/appsignal-*-install.report
89190
- name: Node.js 16 - Tests
90191
dependencies:
91192
- Node.js 16 - Build

Rakefile

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require "set"
34
require "yaml"
45

56
namespace :build_matrix do
@@ -13,13 +14,19 @@ namespace :build_matrix do
1314
matrix["nodejs"].each do |nodejs|
1415
nodejs_version = nodejs["nodejs"]
1516
setup = nodejs.fetch("setup", [])
17+
env_vars = nodejs.fetch("env_vars", [])
1618

1719
build_block_name = "Node.js #{nodejs_version} - Build"
1820
build_block = build_semaphore_task(
1921
"name" => build_block_name,
2022
"dependencies" => ["Validation"],
2123
"task" => {
22-
"env_vars" => ["name" => "NODE_VERSION", "value" => nodejs_version],
24+
"env_vars" => env_vars + [
25+
{
26+
"name" => "NODE_VERSION",
27+
"value" => nodejs_version
28+
}
29+
],
2330
"prologue" => {
2431
"commands" => setup + [
2532
"cache restore",
@@ -98,7 +105,7 @@ namespace :build_matrix do
98105
"name" => primary_block_name,
99106
"dependencies" => [build_block_name],
100107
"task" => {
101-
"env_vars" => [
108+
"env_vars" => env_vars + [
102109
{
103110
"name" => "NODE_VERSION",
104111
"value" => nodejs_version

build_matrix.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,22 @@ matrix:
7070
- "cat /tmp/appsignal-*-install.report"
7171

7272
nodejs:
73-
- nodejs: "16"
74-
setup:
75-
# Configure the host to use GCC 8.3 for Node.js 16. This is the minimal
76-
# required version for Node.js 16, and the extension won't compile
77-
# without it.
73+
- nodejs: "17"
74+
setup: &gcc8
75+
# Configure the host to use GCC 8.3 for Node.js 16 and above. This
76+
# is the minimal required version for Node.js 16 and above, and the
77+
# extension won't compile without it.
7878
- sem-version c 8
79+
env_vars:
80+
# Set `NODE_OPTIONS` to `--openssl-legacy-provider`, as a workaround
81+
# for this `webpack` bug affecting the `@appsignal/nextjs` tests
82+
# when running on Node 17:
83+
# https://github.com/webpack/webpack/issues/14532
84+
# https://github.com/nodejs/node/issues/40455
85+
- name: NODE_OPTIONS
86+
value: "--openssl-legacy-provider"
87+
- nodejs: "16"
88+
setup: *gcc8
7989
- nodejs: "15"
8090
- nodejs: "14"
8191
- nodejs: "13"

0 commit comments

Comments
 (0)