[SDK-4436] test: Migrate CI to GitHub Actions #14
Workflow file for this run
This file contains 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: Integration Tests | |
on: | |
merge_group: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
env: | |
NODE_VERSION: 18 | |
CACHE_KEY: '${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}' | |
DOMAIN: your-tenant.auth0.com | |
AUDIENCE: https://api.example.com/users | |
PORT: 3001 | |
jobs: | |
build: | |
name: Prepare | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build package | |
uses: ./.github/actions/build | |
with: | |
node: ${{ env.NODE_VERSION }} | |
- name: Install `examples/users-api` dependencies | |
run: | | |
npm ci --prefix=examples/users-api | |
- name: Save build artifacts | |
uses: actions/cache/save@v3 | |
with: | |
path: . | |
key: ${{ env.CACHE_KEY }} | |
test-cra: | |
needs: build # Require build to complete before running tests | |
name: Run cra-react-router tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Restore build artifacts | |
uses: actions/cache/restore@v3 | |
with: | |
path: . | |
key: ${{ env.CACHE_KEY }} | |
- name: Run integration tests | |
run: | | |
npm i --prefix=examples/cra-react-router --no-package-lock --legacy-peer-deps | |
npm run test:cra | |
env: | |
SKIP_PREFLIGHT_CHECK: true | |
REACT_APP_DOMAIN: your-tenant.auth0.com | |
REACT_APP_CLIENT_ID: yourclientid | |
REACT_APP_AUDIENCE: https://api.example.com/users | |
REACT_APP_API_PORT: 3001 | |
test-gatsby: | |
needs: build # Require build to complete before running tests | |
name: Run Gatsby tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Restore build artifacts | |
uses: actions/cache/restore@v3 | |
with: | |
path: . | |
key: ${{ env.CACHE_KEY }} | |
- name: Run integration tests | |
run: | | |
npm i --prefix=examples/gatsby-app --no-package-lock --legacy-peer-deps | |
npm run test:gatsby | |
env: | |
GATSBY_DOMAIN: your-tenant.auth0.com | |
GATSBY_CLIENT_ID: yourclientid | |
GATSBY_AUDIENCE: https://api.example.com/users | |
GATSBY_API_PORT: 3001 | |
test-nextjs: | |
needs: build # Require build to complete before running tests | |
name: Run NextJS tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Restore build artifacts | |
uses: actions/cache/restore@v3 | |
with: | |
path: . | |
key: ${{ env.CACHE_KEY }} | |
- name: Run integration tests | |
run: | | |
npm i --prefix=examples/nextjs-app --no-package-lock --legacy-peer-deps | |
npm run test:nextjs | |
env: | |
NEXT_PUBLIC_DOMAIN: your-tenant.auth0.com | |
NEXT_PUBLIC_CLIENT_ID: yourclientid | |
NEXT_PUBLIC_AUDIENCE: https://api.example.com/users | |
NEXT_PUBLIC_API_PORT: 3001 |