Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ on:
required: false
type: boolean
default: false
node_version:
description: 'Node.js version for install, lint, test, and build'
required: false
type: string
default: '18'
outputs:
environment:
description: 'The environment that was processed'
Expand Down Expand Up @@ -54,19 +59,19 @@ jobs:

steps:
- name: Checkout Repo
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: ${{ inputs.node_version }}

- name: Cache NPM dependencies
uses: actions/cache@v4
id: node_modules_cache
with:
path: node_modules
key: ${{ runner.os }}-v18-npm-v3-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-v${{ inputs.node_version }}-npm-v3-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
if: steps.node_modules_cache.outputs.cache-hit != 'true'
Expand All @@ -83,7 +88,6 @@ jobs:
if: inputs.skip_tests != true
run: npm run test
env:
NODE_OPTIONS: '--no-experimental-fetch'
CODECOV_TOKEN: de5ab681-0837-4a24-b614-0a29225a7e4c
MATTERS_ENV: test
MATTERS_LOGGING_LEVEL: critical
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@ on:

jobs:
build:
strategy:
fail-fast: false
matrix:
node-version:
- '18'
- '24'
uses: ./.github/workflows/build.yml
with:
environment: ''
skip_tests: false
skip_docker: true
node_version: ${{ matrix.node-version }}
secrets: {}
21 changes: 21 additions & 0 deletions bin/jest.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { spawnSync } = require('node:child_process')

const major = Number.parseInt(process.versions.node.split('.')[0], 10)
const args = ['--experimental-vm-modules']

if (major < 24) {
args.push('--no-experimental-fetch')
}

args.push('node_modules/.bin/jest', ...process.argv.slice(2))

const result = spawnSync(process.execPath, args, {
stdio: 'inherit',
env: process.env,
})

if (result.error) {
throw result.error
}

process.exit(result.status ?? 1)
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ export default [
},
{
files: ['**/*.cjs'],
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'import/no-commonjs': 'off',
Expand Down
Loading
Loading