Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: split CLI/Node tests #3096

Merged
merged 4 commits into from
Dec 3, 2024
Merged
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
36 changes: 0 additions & 36 deletions .github/workflows/tests-cli-windows.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test node client
name: Run Client Tests

on:
push:
Expand All @@ -8,16 +8,15 @@ on:
pull_request:
merge_group:

concurrency:
group: tests-node-client/${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests-node-client:
runs-on: ubuntu-latest
tests:
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
Expand All @@ -30,21 +29,27 @@ jobs:
cache: 'npm'
node-version: ${{ matrix.node-version }}

- name: Build
- run: npm ci

- name: Build Typescript
run: npm run ts-build

- run: npm run test:cli
- run: npm run test:unit -- packages/cli

- name: Build Node Client
run: |
npm ci
npm run ts-build
pushd packages/node-client
npm run build
popd
npm run -w @nangohq/node build

- name: Test CJS
- name: Test Node CJS
shell: bash
run: |
RES=$(node packages/node-client/tests/built.cjs)
echo "$RES";
[ "$RES" != *"Done"* ] || { exit 1; }

- name: Test ESM
- name: Test Node ESM
shell: bash
run: |
RES=$(node packages/node-client/tests/built.js)
echo "$RES";
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@ concurrency:

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x, 20.x]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: ${{ matrix.node-version }}
node-version-file: '.nvmrc'

- run: npm ci
- run: npm run ts-build
- run: npm run test:unit
- run: npm run test:cli
- run: npm run test:unit -- --exclude packages/cli/
- run: npm run test:integration
Loading