test: run integration for all schema builders #1123
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 [20.x, 22.x, 24.x] | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| 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-test | |
| - 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' \ | |
| --exclude='./workspace.tar.gz' \ | |
| -czf workspace.tar.gz . | |
| - name: Upload workspace | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: workspace-${{ matrix.node-version }} | |
| path: workspace.tar.gz | |
| build-docs: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [24.x] | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup | |
| uses: ./.github/actions/setup-node-pnpm | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| 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@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| name: workspace-${{ matrix.node-version }} | |
| path: . | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm --filter @nahkies/openapi-code-generator-documentation build | |
| integration: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: *node-versions | |
| schema-builder: [joi, zod] | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| 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@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| name: workspace-${{ matrix.node-version }} | |
| path: . | |
| - 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' }} | |
| run: ./scripts/assert-clean-working-directory.sh | |
| e2e: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: *node-versions | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| 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@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| name: workspace-${{ matrix.node-version }} | |
| path: . | |
| - run: pnpm install --frozen-lockfile | |
| - run: SCHEMA_BUILDER=zod pnpm e2e:generate | |
| - run: pnpm e2e:validate | |
| - name: Check for uncommitted changes | |
| run: ./scripts/assert-clean-working-directory.sh |