Skip to content

[v0.48.0] feat: e2e tests use containerized core #2

[v0.48.0] feat: e2e tests use containerized core

[v0.48.0] feat: e2e tests use containerized core #2

Workflow file for this run

name: Auth-React Tests
on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- master
- "v[0-9]+.[0-9]+"
- "ci/github-actions/auth-react/v0.48.0" # TODO: Remove this
tags:
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
jobs:
define-versions:
runs-on: ubuntu-latest
outputs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-supported-versions-action@main
id: versions
with:
has-fdi: true
setup-auth-react:
runs-on: ubuntu-latest
needs: define-versions
strategy:
fail-fast: true
matrix:
# fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }}
fdi-version: ["4.0"]
outputs:
AUTH_REACT__LOG_DIR: ${{ steps.envs.outputs.AUTH_REACT__LOG_DIR }}
AUTH_REACT__SCREENSHOT_DIR: ${{ steps.envs.outputs.AUTH_REACT__SCREENSHOT_DIR }}
AUTH_REACT__NODE_PORT: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__APP_SERVER: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__TEST_MODE: ${{ steps.envs.outputs.AUTH_REACT__TEST_MODE }}
AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }}
specs: ${{ steps.envs.outputs.specs }}
steps:
- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: node
fdi-version: ${{ matrix.fdi-version }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
- uses: supertokens/auth-react-testing-action/setup@main
id: envs
with:
# auth-react-version: ${{ steps.versions.outputs.authReactTag }}
auth-react-version: ci/github-actions/auth-react/v0.49.0
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
fdi-version: ${{ matrix.fdi-version }}
use-common-app-and-test-server: "true"
test:
runs-on: ubuntu-latest
needs: setup-auth-react
strategy:
max-parallel: 10
fail-fast: false
matrix:
# fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }}
fdi-version: ["4.0"]
spec: ${{ fromJSON(needs.setup-auth-react.outputs.specs) }}
env:
SUPERTOKENS_CORE_PORT: 3567
SUPERTOKENS_CORE_HOST: localhost
TEST_MODE: testing
# Auth react setup envs
AUTH_REACT__LOG_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__LOG_DIR }}
AUTH_REACT__SCREENSHOT_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__SCREENSHOT_DIR }}
AUTH_REACT__NODE_PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__APP_SERVER: ${{ needs.setup-auth-react.outputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__TEST_MODE: ${{ needs.setup-auth-react.outputs.AUTH_REACT__TEST_MODE }}
AUTH_REACT__PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__PORT }}
steps:
- uses: actions/checkout@v4
with:
path: supertokens-auth-react
- name: Start core
run: docker compose up --wait
working-directory: supertokens-auth-react
- uses: supertokens/auth-react-testing-action@main
name: test ${{ matrix.spec }} for ${{ matrix.fdi-version }}
with:
fdi-version: ${{ matrix.fdi-version }}
check-name-suffix: "[FDI=${{ matrix.fdi-version }}][Spec=${{ matrix.spec }}]"
path: supertokens-auth-react
spec: ${{ matrix.spec }}