Skip to content

chore: bump gh action deps, drop node v20 from ci #1433

chore: bump gh action deps, drop node v20 from ci

chore: bump gh action deps, drop node v20 from ci #1433

Workflow file for this run

name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: &node-versions [22.x, 24.x]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- run: pnpm install --frozen-lockfile
- run: node ./scripts/generate-ajv-validator.js
- run: pnpm tsc -b tsconfig.json
- run: pnpm ci-lint
- name: Check for uncommitted changes
run: ./scripts/assert-clean-working-directory.sh
- name: Create workspace archive
run: |
tar --exclude='./node_modules' \
--exclude='./**/node_modules' \
--exclude='./.git' \
--exclude='./coverage' \
--exclude='./**/*.log' \
-cvf ${{ runner.temp }}/workspace.tar .
- name: Upload workspace
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
# todo: use archive: false?
name: workspace-${{ matrix.node-version }}
path: ${{ runner.temp }}/workspace.tar
retention-days: 7
build-docs:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: nextjs-cache
with:
path: packages/documentation/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
- name: Download built workspace
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: workspace-${{ matrix.node-version }}
path: ${{runner.temp}}
- name: Extract workspace
run: |
tar -xf ${{runner.temp}}/workspace.tar -C .
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @nahkies/openapi-code-generator-documentation build
unit:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: *node-versions
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- name: Download built workspace
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: workspace-${{ matrix.node-version }}
path: ${{runner.temp}}
- name: Extract workspace
run: |
tar -xf ${{runner.temp}}/workspace.tar -C .
- run: pnpm install --frozen-lockfile
- run: pnpm run ci-test
- name: Check for uncommitted changes
run: ./scripts/assert-clean-working-directory.sh
integration:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: *node-versions
schema-builder: [joi, zod-v3, zod-v4]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- name: Download built workspace
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: workspace-${{ matrix.node-version }}
path: ${{runner.temp}}
- name: Extract workspace
run: |
tar -xf ${{runner.temp}}/workspace.tar -C .
- run: pnpm install --frozen-lockfile
- run: pnpm integration:clean
- run: pnpm integration:generate --schema-builder ${{ matrix.schema-builder }}
- run: pnpm integration:validate
- name: Check for uncommitted changes
if: ${{ matrix.schema-builder == 'zod-v4' }}
run: ./scripts/assert-clean-working-directory.sh
e2e:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: *node-versions
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- name: Download built workspace
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: workspace-${{ matrix.node-version }}
path: ${{runner.temp}}
- name: Extract workspace
run: |
tar -xf ${{runner.temp}}/workspace.tar -C .
- run: pnpm install --frozen-lockfile
- run: SCHEMA_BUILDER=zod-v3 pnpm e2e:generate
- run: pnpm e2e:validate
- run: SCHEMA_BUILDER=zod-v4 pnpm e2e:generate
- run: pnpm e2e:validate
- name: Check for uncommitted changes
run: ./scripts/assert-clean-working-directory.sh