Skip to content

feat: adds dev/release pipelines, auth-react tests #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Aug 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4e98b40
Add workflow for unit tests
deepjyoti30-st Apr 14, 2025
48b8f63
Merge pull request #128 from supertokens/ci/github-actions/auth-react…
sattvikc Apr 18, 2025
1e913aa
feat: adds auth-react test workflow
namsnath Aug 8, 2025
f771d0a
fix: don't fetch frontend versions
namsnath Aug 8, 2025
f5b8e68
empty commit to trigger tests
namsnath Aug 8, 2025
e8e7863
fix: node cdi version output
namsnath Aug 8, 2025
894d305
update: adds test step for versions
namsnath Aug 8, 2025
b441f64
update: GHA concurrency to cancel runs if new commit pushed
namsnath Aug 8, 2025
59fe1c4
fix: use secrets: inherit in called workflow
namsnath Aug 8, 2025
401b89a
fix: try to re-install deps to resolve issues
namsnath Aug 8, 2025
eb30680
fix: try to use relative symlink path
namsnath Aug 8, 2025
89f6c30
fix: only prep, no install after linking deps
namsnath Aug 8, 2025
2de44a2
fix: try specifying node version
namsnath Aug 8, 2025
0a65b02
fix: try without removing supertokens-website
namsnath Aug 8, 2025
cf057e5
fix: try setting up auth-react manually
namsnath Aug 9, 2025
b96f726
update: adds ssh debug step
namsnath Aug 9, 2025
8da167a
fix: use Xy auth-react branch instead of latest tag
namsnath Aug 9, 2025
85ac279
Revert "fix: use Xy auth-react branch instead of latest tag"
namsnath Aug 9, 2025
97f6ed9
Revert "update: adds ssh debug step"
namsnath Aug 9, 2025
1b09b1e
Revert "fix: try setting up auth-react manually"
namsnath Aug 9, 2025
1189f1c
Revert "fix: try without removing supertokens-website"
namsnath Aug 9, 2025
867a2b9
fix: use Xy auth-react branch instead of latest tag
namsnath Aug 9, 2025
5fa9928
fix: do not remove supertokens-website dep
namsnath Aug 9, 2025
d2f0a3c
feat: adds dev/release pipelines
namsnath Aug 9, 2025
fe087a5
fix: json payload release variable
namsnath Aug 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions .github/workflows/auth-react-test-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Auth-React Tests - L1

on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
tags:
- dev-v[0-9]+.[0-9]+.[0-9]+

# Only one instance of this workflow will run on the same ref (PR/Branch/Tag)
# Previous runs will be cancelled.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
define-versions:
runs-on: ubuntu-latest
outputs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
webJsInterfaceVersion: ${{ steps.versions.outputs.webJsInterfaceVersion }}
steps:
- uses: actions/checkout@v4

- uses: supertokens/get-supported-versions-action@main
id: versions
with:
has-fdi: true
has-web-js: true

setup-auth-react:
runs-on: ubuntu-latest
needs: define-versions
strategy:
fail-fast: true
matrix:
fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }}

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 }}
fdiVersions: ${{ needs.define-versions.outputs.fdiVersions }}

steps:
- uses: actions/checkout@v4
with:
path: supertokens-web-js

- uses: actions/setup-node@v4
with:
node-version: 20

- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: node
fdi-version: ${{ matrix.fdi-version }}
fetch-frontend-versions: false
web-js-interface-version: ${{ needs.define-versions.outputs.webJsInterfaceVersion }}
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.webJsReactVersionXy }}
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
fdi-version: ${{ matrix.fdi-version }}
use-common-app-and-test-server: "true"
persist-workspace: "false"

# We will use this in the test run to get the core version
- uses: actions/checkout@v4
with:
repository: supertokens/supertokens-node
ref: ${{ steps.versions.outputs.nodeTag }}
path: supertokens-node

- name: Copy over required dependencies
run: |
cd supertokens-web-js
# Create a tarball of the web-js package
npm pack

cd ../supertokens-auth-react
# Extract the tarball to the auth-react package
tar -xf ../supertokens-web-js/supertokens-web-js-*.tgz --strip-components=1 -C node_modules/supertokens-web-js
# # Remove existing website package and link to the one from web-js
# rm -rf node_modules/supertokens-website
# ln -s "../supertokens-web-js/node_modules/supertokens-website" node_modules

- name: Set up auth-react with new dependencies
working-directory: supertokens-auth-react/examples/for-tests
env:
# Common
APP_SERVER: ${{ steps.envs.outputs.AUTH_REACT__APP_SERVER }}
NODE_PORT: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
TEST_MODE: ${{ steps.envs.outputs.AUTH_REACT__TEST_MODE }}
# Step-specific
CI: true
BROWSER: none
PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }}
REACT_APP_API_PORT: ${{ steps.envs.outputs.AUTH_REACT__APP_SERVER }}
run: |
npm run prep

- uses: bissolli/gh-action-persist-workspace@v2
with:
action: persist
artifactName: auth-react-${{ matrix.fdi-version }}

launch-test-workflow:
uses: ./.github/workflows/auth-react-test-2.yml
needs: setup-auth-react
name: FDI ${{ matrix.fdi-version }}
strategy:
max-parallel: 1 # This is important to avoid ddos GHA API
fail-fast: false # Don't fail fast to avoid locking TF State
matrix:
fdi-version: ${{ fromJSON(needs.setup-auth-react.outputs.fdiVersions) }}
with:
fdi-version: ${{ matrix.fdi-version }}
specs: ${{ needs.setup-auth-react.outputs.specs }}
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__APP_SERVER: ${{ needs.setup-auth-react.outputs.AUTH_REACT__APP_SERVER }}
AUTH_REACT__NODE_PORT: ${{ 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 }}
secrets: inherit
119 changes: 119 additions & 0 deletions .github/workflows/auth-react-test-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Auth-React Tests - L2
on:
workflow_call:
inputs:
fdi-version:
description: "FDI Version"
required: true
type: string

specs:
description: "Spec Files"
required: true
type: string

AUTH_REACT__LOG_DIR:
description: AUTH_REACT__LOG_DIR
required: true
type: string

AUTH_REACT__SCREENSHOT_DIR:
description: AUTH_REACT__SCREENSHOT_DIR
required: true
type: string

AUTH_REACT__APP_SERVER:
description: AUTH_REACT__APP_SERVER
required: true
type: string

AUTH_REACT__NODE_PORT:
description: AUTH_REACT__NODE_PORT
required: true
type: string

AUTH_REACT__TEST_MODE:
description: AUTH_REACT__TEST_MODE
required: true
type: string

AUTH_REACT__PORT:
description: AUTH_REACT__PORT
required: true
type: string

jobs:
test:
runs-on: ubuntu-latest

strategy:
max-parallel: 10
fail-fast: false
matrix:
spec: ${{ fromJSON(inputs.specs) }}

env:
SUPERTOKENS_CORE_PORT: 3567
SUPERTOKENS_CORE_HOST: localhost
TEST_MODE: testing
# Auth react setup envs
AUTH_REACT__LOG_DIR: ${{ inputs.AUTH_REACT__LOG_DIR }}
AUTH_REACT__SCREENSHOT_DIR: ${{ inputs.AUTH_REACT__SCREENSHOT_DIR }}
AUTH_REACT__NODE_PORT: ${{ inputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__APP_SERVER: ${{ inputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__TEST_MODE: ${{ inputs.AUTH_REACT__TEST_MODE }}
AUTH_REACT__PORT: ${{ inputs.AUTH_REACT__PORT }}
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}

steps:
- uses: actions/setup-node@v4
with:
node-version: 20

- uses: bissolli/gh-action-persist-workspace@v2
with:
action: retrieve
artifactName: auth-react-${{ inputs.fdi-version }}

- name: Get Node CDI versions
id: node-cdi-versions
uses: supertokens/get-supported-versions-action@main
with:
has-cdi: true
working-directory: supertokens-node

- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: node
fdi-version: ${{ inputs.fdi-version }}

- name: Get last Node CDI version
id: last-node-cdi-version
run: |
export lastVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]')
echo "lastNodeCdiVersion=$lastVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"

- name: Get Core version
id: core-version
uses: supertokens/get-versions-action@main
with:
driver-name: node
cdi-version: ${{ steps.last-node-cdi-version.outputs.lastNodeCdiVersion }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}

- name: Start core
run: docker compose up --wait
working-directory: supertokens-web-js
env:
SUPERTOKENS_CORE_VERSION: ${{ steps.core-version.outputs.coreVersionXy }}

- uses: supertokens/auth-react-testing-action@main
name: test ${{ matrix.spec }} for ${{ inputs.fdi-version }}
with:
fdi-version: ${{ inputs.fdi-version }}
check-name-suffix: "[FDI=${{ inputs.fdi-version }}][Spec=${{ matrix.spec }}]"
path: supertokens-auth-react
spec: ${{ matrix.spec }}
retrieve-workspace: "false"
Loading
Loading