From 4c10c568eed25bfeaf3c8e2d1d396f2e1a7d3423 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Fri, 10 Jul 2026 12:11:17 +0200 Subject: [PATCH 1/2] ci: add build workflow for examples Add a 'Build and Test Examples' workflow that builds each example on PRs and pushes to main, mirroring the auth0-express examples CI. Also add a build script to example-fastify-api so the workflow can verify it compiles. --- .github/workflows/examples.yml | 73 +++++++++++++++++++++++ examples/example-fastify-api/package.json | 3 +- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/examples.yml diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml new file mode 100644 index 0000000..273ddf3 --- /dev/null +++ b/.github/workflows/examples.yml @@ -0,0 +1,73 @@ +name: Build and Test Examples + +on: + merge_group: + workflow_dispatch: + pull_request: + branches: [main, early-access] + push: + branches: [main, early-access] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + example-fastify-web: + name: Web App + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + + - name: Setup Node.js with npm caching + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 22 + package-manager-cache: false + + - name: Update npm + run: npm install -g npm@11.10.0 + + - name: Install dependencies + run: npm install + + # The example imports @auth0/auth0-fastify from its built dist, so the + # SDK must be built before the example can build. + - name: Build auth0-fastify + run: npm run build -w @auth0/auth0-fastify + + - name: Build example-fastify-web + run: npm run build -w example-fastify-web + + example-fastify-api: + name: API + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + + - name: Setup Node.js with npm caching + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 22 + package-manager-cache: false + + - name: Update npm + run: npm install -g npm@11.10.0 + + - name: Install dependencies + run: npm install + + # The example imports @auth0/auth0-fastify-api from its built dist, so the + # SDK must be built before the example can build. + - name: Build auth0-fastify-api + run: npm run build -w @auth0/auth0-fastify-api + + - name: Build example-fastify-api + run: npm run build -w example-fastify-api diff --git a/examples/example-fastify-api/package.json b/examples/example-fastify-api/package.json index c2bb601..9d413c9 100644 --- a/examples/example-fastify-api/package.json +++ b/examples/example-fastify-api/package.json @@ -4,7 +4,8 @@ "description": "", "type": "module", "scripts": { - "start": "tsx src/index.ts --project tsconfig.json" + "start": "tsx src/index.ts --project tsconfig.json", + "build": "tsc --project tsconfig.json" }, "devDependencies": { "ts-node": "^10.9.2", From 29240ebac4e229ab6556479b867cce1ca7ed55dc Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Fri, 10 Jul 2026 12:13:53 +0200 Subject: [PATCH 2/2] ci: drop early-access branch trigger from examples workflow --- .github/workflows/examples.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 273ddf3..fe77c03 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -4,9 +4,9 @@ on: merge_group: workflow_dispatch: pull_request: - branches: [main, early-access] + branches: [main] push: - branches: [main, early-access] + branches: [main] permissions: contents: read