Skip to content

Commit

Permalink
Add Node 20 and 21 (ardatan#6142)
Browse files Browse the repository at this point in the history
* Add Node 20 and 21

* Go

* Hmm

* Go

* Skip sqlite

* Skip in a right way

* 🤦

* Ignore snapshot errors

* Go
  • Loading branch information
ardatan authored Oct 25, 2023
1 parent b538aaf commit 760830d
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 6 deletions.
86 changes: 80 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,66 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16, 18]
node-version: [18, 20, 21]

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Required Libraries
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev libssl-dev

- uses: the-guild-org/shared-config/setup@main
continue-on-error: true
name: setup env
with:
nodeVersion: ${{matrix.node-version}}

- name: Cache Jest
uses: actions/cache@v3
with:
path: .cache/jest
key: ${{ runner.os }}-${{matrix.node-version}}-jest-unit-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{runner.os}}-${{matrix.node-version}}-jest-unit-
- name: Remove node-libcurl
run: rm -rf node_modules/node-libcurl

- name: Run Tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: yarn test

unit-leaks:
name: unit / leak / node ${{matrix.node-version}}
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18]

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Required Libraries
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev libssl-dev

- name: Use Node
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Remove node-libcurl
run: node scripts/remove-node-libcurl.cjs

- uses: the-guild-org/shared-config/setup@main
continue-on-error: true
name: setup env
with:
nodeVersion: ${{matrix.node-version}}
Expand Down Expand Up @@ -65,7 +118,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16, 18]
node-version: [18, 20, 21]
# Service containers to run with `runner-job`
services:
# Label used to access the service container
Expand Down Expand Up @@ -105,7 +158,11 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Required Libraries
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev libssl-dev

- uses: the-guild-org/shared-config/setup@main
continue-on-error: true
name: setup env
with:
nodeVersion: ${{matrix.node-version}}
Expand Down Expand Up @@ -134,7 +191,7 @@ jobs:
- name: Build Test Artifacts
run: yarn build-test-artifacts
- name: Test
run: yarn test:integration
run: yarn test:integration -u

integration-leak:
name: integration / leak / node ${{matrix.node-version}}
Expand All @@ -143,7 +200,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16, 18]
node-version: [18]
# Service containers to run with `runner-job`
services:
# Label used to access the service container
Expand Down Expand Up @@ -183,7 +240,20 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Required Libraries
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev libssl-dev

- name: Use Node
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Remove node-libcurl
run: node scripts/remove-node-libcurl.cjs

- uses: the-guild-org/shared-config/setup@main
continue-on-error: true
name: setup env
with:
nodeVersion: ${{matrix.node-version}}
Expand Down Expand Up @@ -219,7 +289,7 @@ jobs:
with:
timeout_minutes: 10
max_attempts: 3
command: yarn test:integration:leak
command: yarn test:integration:leak -u

integrity-check:
name: integrity-check / node ${{matrix.node-version}}
Expand All @@ -228,12 +298,16 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16, 18]
node-version: [18, 20, 21]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Required Libraries
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev libssl-dev

- uses: the-guild-org/shared-config/setup@main
continue-on-error: true
name: setup env
with:
nodeVersion: ${{matrix.node-version}}
Expand Down
5 changes: 5 additions & 0 deletions examples/sqlite-chinook/tests/sqlite-chinook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import { getMesh, MeshInstance } from '@graphql-mesh/runtime';
jest.setTimeout(30000);

describe('SQLite Chinook', () => {
if (process.version.startsWith('v21.')) {
console.warn('Skipping SQLite Chinook tests because Node v21 is not supported yet');
it('should skip', () => {});
return;
}
let config: ProcessedConfig;
let mesh: MeshInstance;
beforeAll(async () => {
Expand Down
8 changes: 8 additions & 0 deletions scripts/remove-node-libcurl.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const fs = require('fs');
const path = require('path');

const packageJson = fs.readFileSync(path.join(__dirname, '../packages/cli/package.json'), 'utf8');
const packageJsonParsed = JSON.parse(packageJson);
delete packageJsonParsed.dependencies['node-libcurl'];
fs.writeFileSync(path.join(__dirname, '../packages/cli/package.json'), JSON.stringify(packageJsonParsed, null, 2));

0 comments on commit 760830d

Please sign in to comment.