Skip to content

Commit

Permalink
Merge pull request #144 from solarwindscloud/NH-55985
Browse files Browse the repository at this point in the history
Attempt to fix test workflows
  • Loading branch information
raphael-theriault-swi authored Oct 31, 2023
2 parents 8595c19 + e7bf0b3 commit 6c9e600
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 52 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
lfs: true
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- run: corepack enable

- uses: actions/cache@v3
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- run: corepack enable

- uses: actions/cache@v3
Expand Down Expand Up @@ -104,17 +104,14 @@ jobs:
action: launch
github-token: ${{ steps.github-token.outputs.token }}
matrix: |
16-alpine3.15
16-amazonlinux2
16-amazonlinux2023
16-debian10
16-ubi8
16-ubuntu18.04
18-alpine
16-ubuntu20.04
18-amazonlinux
18-debian
18-ubi
18-ubuntu
20-alpine
20-amazonlinux
20-debian
20-ubi
Expand All @@ -136,11 +133,11 @@ jobs:
strategy:
matrix:
image:
- 16-alpine3.15
- 16-amazonlinux2
- 16-alpine3.16
- 16-amazonlinux2023
- 16-debian10
- 16-ubi8
- 16-ubuntu18.04
- 16-ubuntu20.04
- 18-alpine
- 18-amazonlinux
- 18-debian
Expand All @@ -154,6 +151,14 @@ jobs:
arch:
- x64
- arm64
# https://github.com/actions/runner/issues/801
exclude:
- image: 16-alpine3.16
arch: arm64
- image: 18-alpine
arch: arm64
- image: 20-alpine
arch: arm64
fail-fast: false
container:
image: ghcr.io/${{ github.repository }}/dev:${{ matrix.image }}
Expand All @@ -164,9 +169,6 @@ jobs:
YARN_IGNORE_NODE: 1

steps:
- if: matrix.arch == 'arm64' && contains(matrix.image, 'alpine')
run: sed -i "s/ID=alpine/ID=armpine/" /etc/os-release

- uses: actions/checkout@v4
with:
lfs: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
strategy:
matrix:
image:
- 16-alpine3.15
- 16-amazonlinux2
- 16-alpine3.16
- 16-amazonlinux2023
- 16-debian10
- 16-ubi8
- 16-ubuntu18.04
- 16-ubuntu20.04
- 18-alpine
- 18-amazonlinux
- 18-debian
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
lfs: true
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- run: corepack enable

- run: yarn install --immutable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
lfs: true
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- run: corepack enable

- uses: actions/cache@v3
Expand Down
9 changes: 9 additions & 0 deletions .yarn/versions/1ce1ee8c.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@solarwinds-apm/test": minor

declined:
- "@solarwinds-apm/bindings"
- "@solarwinds-apm/compat"
- "@solarwinds-apm/dependencies"
- "@solarwinds-apm/sdk"
- solarwinds-apm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine3.15
FROM node:16-alpine3.16

RUN apk add --no-cache \
curl \
Expand Down
18 changes: 0 additions & 18 deletions docker/16-amazonlinux2.Dockerfile

This file was deleted.

17 changes: 17 additions & 0 deletions docker/16-amazonlinux2023.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM amazonlinux:2023

RUN dnf install -y \
curl-minimal \
git \
git-lfs \
tar \
xz

RUN dnf install -y https://rpm.nodesource.com/pub_16.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm && \
dnf install -y nodejs && \
dnf clean -y all

RUN corepack enable

WORKDIR /solarwinds-apm
ENTRYPOINT ["/bin/bash", "-c"]
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

RUN apt-get update && apt-get install -y software-properties-common

RUN add-apt-repository ppa:git-core/ppa && \
apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
git \
Expand Down
8 changes: 4 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
16-alpine:
build:
context: .
dockerfile: 16-alpine3.15.Dockerfile
dockerfile: 16-alpine3.16.Dockerfile
environment:
YARN_IGNORE_NODE: 1
volumes:
Expand All @@ -14,7 +14,7 @@ services:
16-amazonlinux:
build:
context: .
dockerfile: 16-amazonlinux2.Dockerfile
dockerfile: 16-amazonlinux2023.Dockerfile
environment:
YARN_IGNORE_NODE: 1
volumes:
Expand Down Expand Up @@ -47,7 +47,7 @@ services:
16-ubuntu:
build:
context: .
dockerfile: 16-ubuntu18.04.Dockerfile
dockerfile: 16-ubuntu20.04.Dockerfile
environment:
YARN_IGNORE_NODE: 1
volumes:
Expand Down Expand Up @@ -151,7 +151,7 @@ services:
example:
build:
context: .
dockerfile: 18-ubuntu.Dockerfile
dockerfile: 20-ubuntu.Dockerfile
volumes:
- ..:/solarwinds-apm
links:
Expand Down
12 changes: 6 additions & 6 deletions packages/test/src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ const DEFAULTS = [
const resolve = createRequire(callsite().getFileName()!).resolve

// TSX registers a custom loader that lets Node import TypeScript files
const tsxLoaderPath = pathToFileURL(resolve("tsx")).toString()
const tsxRequirePath = resolve("tsx/preflight")
const tsxPath = pathToFileURL(resolve("tsx")).toString()

// Skip Node executable and current script path
let argv = process.argv.slice(2)
Expand Down Expand Up @@ -90,15 +89,16 @@ const reporter = semver.gte(process.versions.node, "18.0.0")
? ["--test-reporter", "spec"]
: []

const loader = semver.gte(process.versions.node, "20.8.0")
? ["--import", tsxPath]
: ["--loader", tsxPath]

argv = [
// Launch Node in test runner mode
"--test",
...reporter,
// Register TSX loaders
"--require",
tsxRequirePath,
"--loader",
tsxLoaderPath,
...loader,
// Forward the rest of our parameters
...process.execArgv,
...argv,
Expand Down

0 comments on commit 6c9e600

Please sign in to comment.