Skip to content

Commit

Permalink
Add Node 17 to the build matrix
Browse files Browse the repository at this point in the history
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
  • Loading branch information
unflxw committed Oct 26, 2021
1 parent 67d7fc1 commit f598583
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 8 deletions.
105 changes: 103 additions & 2 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ blocks:
- name: Git Lint (Lintje)
commands:
- script/lint_git
- name: Node.js 16 - Build
- name: Node.js 17 - Build
dependencies:
- Validation
task:
env_vars:
- name: NODE_OPTIONS
value: "--openssl-legacy-provider"
- name: NODE_VERSION
value: '16'
value: '17'
prologue:
commands:
- sem-version c 8
Expand All @@ -86,6 +88,105 @@ blocks:
- cache store $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION packages
- cache store $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
/tmp/appsignal-*-install.report
- name: Node.js 17 - Tests
dependencies:
- Node.js 17 - Build
task:
env_vars:
- name: NODE_VERSION
value: '17'
- name: _APPSIGNAL_EXTENSION_INSTALL
value: 'false'
prologue:
commands:
- sem-version c 8
- cache restore
- cache restore $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
- cache restore $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
- mono bootstrap --ci
epilogue: *1
jobs:
- name: "@appsignal/nodejs - nodejs"
commands:
- mono test --package=@appsignal/nodejs
- name: "@appsignal/nodejs - nodejs - diagnose"
commands:
- git submodule init
- git submodule update
- LANGUAGE=nodejs test/integration/diagnose/bin/test
- name: "@appsignal/nodejs-ext - nodejs-ext"
commands:
- mono test --package=@appsignal/nodejs-ext
- mono run --package @appsignal/nodejs-ext -- npm run test:failure
- name: "@appsignal/apollo-server - apollo-server@latest - integrations"
commands:
- script/install_test_example_packages apollo-server apollo-server-plugin-base@latest
- script/test_package_integration apollo-server
- name: "@appsignal/apollo-server - [email protected] - integrations"
commands:
- script/install_test_example_packages apollo-server [email protected]
- script/test_package_integration apollo-server
- name: "@appsignal/apollo-server - [email protected] - integrations"
commands:
- script/install_test_example_packages apollo-server [email protected]
- script/test_package_integration apollo-server
- name: "@appsignal/apollo-server - [email protected] - integrations"
commands:
- script/install_test_example_packages apollo-server [email protected]
- script/test_package_integration apollo-server
- name: "@appsignal/express - express@latest - integrations"
commands:
- script/install_test_example_packages express express@latest
- script/test_package_integration express
- name: "@appsignal/express - [email protected] - integrations"
commands:
- script/install_test_example_packages express [email protected]
- script/test_package_integration express
- name: "@appsignal/koa - koa@latest - integrations"
commands:
- script/install_test_example_packages koa koa@latest
- script/test_package_integration koa
- name: "@appsignal/koa - [email protected] - integrations"
commands:
- script/install_test_example_packages koa [email protected]
- script/test_package_integration koa
- name: "@appsignal/koa - [email protected] - integrations"
commands:
- script/install_test_example_packages koa [email protected]
- script/test_package_integration koa
- name: "@appsignal/nextjs - next.js@latest - integrations"
commands:
- script/install_test_example_packages nextjs next@latest react@latest react-dom@latest
- script/test_package_integration nextjs
- name: "@appsignal/nextjs - [email protected] - integrations"
commands:
- script/install_test_example_packages nextjs [email protected] [email protected] [email protected]
- script/test_package_integration nextjs
- name: "@appsignal/nextjs - [email protected] - integrations"
commands:
- script/install_test_example_packages nextjs [email protected] [email protected] [email protected]
- script/test_package_integration nextjs
- name: Node.js 16 - Build
dependencies:
- Validation
task:
env_vars:
- name: NODE_VERSION
value: '16'
prologue:
commands:
- sem-version c 8
- cache restore
- mono bootstrap --ci
- cache store
epilogue: *1
jobs:
- name: Build
commands:
- mono build
- cache store $_PACKAGES_CACHE-packages-$SEMAPHORE_GIT_SHA-v$NODE_VERSION packages
- cache store $_PACKAGES_CACHE-install-report-$SEMAPHORE_GIT_SHA-v$NODE_VERSION
/tmp/appsignal-*-install.report
- name: Node.js 16 - Tests
dependencies:
- Node.js 16 - Build
Expand Down
6 changes: 5 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require "set"
require "yaml"

namespace :build_matrix do
Expand All @@ -13,13 +14,16 @@ namespace :build_matrix do
matrix["nodejs"].each do |nodejs|
nodejs_version = nodejs["nodejs"]
setup = nodejs.fetch("setup", [])
env_vars = nodejs.fetch("env_vars", [])

build_block_name = "Node.js #{nodejs_version} - Build"
build_block = build_semaphore_task(
"name" => build_block_name,
"dependencies" => ["Validation"],
"task" => {
"env_vars" => ["name" => "NODE_VERSION", "value" => nodejs_version],
"env_vars" => env_vars + [
{"name" => "NODE_VERSION", "value" => nodejs_version}
],
"prologue" => {
"commands" => setup + [
"cache restore",
Expand Down
18 changes: 13 additions & 5 deletions build_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,20 @@ matrix:
- "cat /tmp/appsignal-*-install.report"

nodejs:
- nodejs: "16"
setup:
# Configure the host to use GCC 8.3 for Node.js 16. This is the minimal
# required version for Node.js 16, and the extension won't compile
# without it.
- nodejs: "17"
setup: &gcc8
# Configure the host to use GCC 8.3 for Node.js 16 and above. This
# is the minimal required version for Node.js 16 and above, and the
# extension won't compile without it.
- sem-version c 8
env_vars:
# Set `NODE_OPTIONS` to `--openssl-legacy-provider`, as a workaround
# for this `webpack` bug affecting our `@appsignal/nextjs` tests:
# https://github.com/webpack/webpack/issues/14532
- name: NODE_OPTIONS
value: "--openssl-legacy-provider"
- nodejs: "16"
setup: *gcc8
- nodejs: "15"
- nodejs: "14"
- nodejs: "13"
Expand Down

0 comments on commit f598583

Please sign in to comment.