Skip to content
Open
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
100 changes: 67 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,18 @@ on:
inputs:
nodejs-version:
description: 'Node.js version to use (e.g., 24.0.0-rc.1)'
required: true
required: false
type: string
use-npm-registry:
description: 'Use npm registry (https://registry.npmjs.org/)'
required: false
type: boolean
default: false
runner-label:
description: 'Runner label to use for jobs'
required: false
type: string
default: 'tenki-standard-autoscale'

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
Expand All @@ -31,8 +41,8 @@ permissions:
jobs:
dependency-review:
name: Dependency Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
# if: github.event_name == 'pull_request'
runs-on: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}
permissions:
contents: read
steps:
Expand All @@ -46,7 +56,7 @@ jobs:

check-licenses:
name: Check licenses
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}
permissions:
contents: read
steps:
Expand All @@ -57,22 +67,24 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: ${{ inputs.nodejs-version || 'lts/*' }}
cache: 'npm'
cache-dependency-path: package.json
check-latest: true

- name: Install
run: |
npm install --ignore-scripts
env:
npm_config_registry: ${{ inputs.use-npm-registry && 'https://registry.npmjs.org/' || '' }}

- name: Check licenses
run: |
npx license-checker --production --summary --onlyAllow="0BSD;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT;"

lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}
permissions:
contents: read
steps:
Expand All @@ -83,15 +95,17 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: ${{ inputs.nodejs-version || 'lts/*' }}
cache: 'npm'
cache-dependency-path: package.json
check-latest: true

- name: Install
run: |
npm install --ignore-scripts

env:
npm_config_registry: ${{ inputs.use-npm-registry && 'https://registry.npmjs.org/' || '' }}

- name: Lint code
run: |
npm run lint
Expand All @@ -102,13 +116,19 @@ jobs:
permissions:
contents: read
uses: ./.github/workflows/coverage-nix.yml
with:
use-npm-registry: ${{ inputs.use-npm-registry || false }}
runner-label: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}

coverage-win:
needs:
- lint
permissions:
contents: read
uses: ./.github/workflows/coverage-win.yml
with:
use-npm-registry: ${{ inputs.use-npm-registry || false }}
runner-label: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}

test-unit:
needs:
Expand All @@ -122,7 +142,8 @@ jobs:
strategy:
matrix:
node-version: [20, 22, 24]
os: [macos-latest, ubuntu-latest, windows-latest]
os: ['${{ inputs.runner-label || ''tenki-standard-autoscale'' }}']
# os: [macos-latest, ${{ inputs.runner-label || 'tenki-standard-autoscale' }}, windows-latest]

steps:
- uses: actions/checkout@v4
Expand All @@ -140,15 +161,18 @@ jobs:
- name: Install
run: |
npm install --ignore-scripts
env:
npm_config_registry: ${{ inputs.use-npm-registry && 'https://registry.npmjs.org/' || '' }}

- name: Run tests
run: |
npm run unit

# Useful for testing Release Candidates of Node.js
test-unit-custom:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
# if: github.event_name == 'workflow_dispatch'
if: ${{ inputs.nodejs-version != '' }}
runs-on: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}
permissions:
contents: read

Expand All @@ -160,14 +184,16 @@ jobs:
- name: Use Custom Node.js Version
uses: actions/setup-node@v4
with:
node-version: ${{ github.event.inputs.nodejs-version }}
node-version: ${{ inputs.nodejs-version }}
cache: 'npm'
cache-dependency-path: package.json
check-latest: true

- name: Install
run: |
npm install --ignore-scripts
env:
npm_config_registry: ${{ inputs.use-npm-registry && 'https://registry.npmjs.org/' || '' }}

- name: Run tests
run: |
Expand All @@ -178,7 +204,7 @@ jobs:
- lint
- coverage-nix
- coverage-win
runs-on: 'ubuntu-latest'
runs-on: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}
permissions:
contents: read

Expand All @@ -197,6 +223,8 @@ jobs:
- name: Install
run: |
npm install --ignore-scripts
env:
npm_config_registry: ${{ inputs.use-npm-registry && 'https://registry.npmjs.org/' || '' }}

- name: Run typescript tests
run: |
Expand All @@ -208,7 +236,7 @@ jobs:
needs:
- test-typescript
- test-unit
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}
permissions:
contents: read
steps:
Expand All @@ -218,40 +246,46 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: ${{ inputs.nodejs-version || 'lts/*' }}
cache: 'npm'
cache-dependency-path: package.json
check-latest: true
- name: install fastify
- name: Install
run: |
npm install --ignore-scripts
env:
npm_config_registry: ${{ inputs.use-npm-registry && 'https://registry.npmjs.org/' || '' }}
- name: install webpack stack
run: |
cd test/bundler/webpack && npm install --ignore-scripts
env:
npm_config_registry: ${{ inputs.use-npm-registry && 'https://registry.npmjs.org/' || '' }}
- name: Test webpack bundle
run: |
cd test/bundler/webpack && npm run test
- name: install esbuild stack
run: |
cd test/bundler/esbuild && npm install --ignore-scripts
env:
npm_config_registry: ${{ inputs.use-npm-registry && 'https://registry.npmjs.org/' || '' }}
- name: Test esbuild bundle
run: |
cd test/bundler/esbuild && npm run test

automerge:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs:
- test-typescript
- test-unit
- package
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# automerge:
# if: >
# github.event_name == 'pull_request' &&
# github.event.pull_request.head.repo.full_name == github.repository &&
# github.event.pull_request.user.login == 'dependabot[bot]'
# needs:
# - test-typescript
# - test-unit
# - package
# runs-on: ${{ inputs.runner-label || 'tenki-standard-autoscale' }}
# permissions:
# pull-requests: write
# contents: write
# steps:
# - uses: fastify/github-action-merge-dependabot@v3
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
Loading