fix: use correct secret for API key #29
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: 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 }} | |
authReactFdiVersionMap: ${{ steps.auth-react-versions.outputs.fdiVersions }} | |
authReactWjiVersionMap: ${{ steps.auth-react-versions.outputs.webJsInterfaceVersions }} | |
nodeFdiVersionMap: ${{ steps.node-versions.outputs.fdiVersions }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: supertokens/get-supported-versions-action@main | |
id: versions | |
with: | |
has-fdi: true | |
has-web-js: true | |
- uses: supertokens/actions/get-versions-from-repo@main | |
id: auth-react-versions | |
with: | |
repo: supertokens-auth-react | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
fdi-versions: ${{ steps.versions.outputs.fdiVersions }} | |
wji-versions: "[${{ steps.versions.outputs.webJsInterfaceVersion }}]" | |
- uses: supertokens/actions/get-versions-from-repo@main | |
id: node-versions | |
with: | |
repo: supertokens-node | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
fdi-versions: ${{ steps.versions.outputs.fdiVersions }} | |
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 | |
- id: repo-versions | |
run: | | |
authReactVersionFromFdi=$( echo '${{ needs.define-versions.outputs.authReactFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' ) | |
authReactVersionFromWji=$( echo '${{ needs.define-versions.outputs.authReactWjiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' ) | |
nodeVersion=$( echo '${{ needs.define-versions.outputs.nodeFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' ) | |
echo "authReactVersionFromFdi=${authReactVersionFromFdi}" >> $GITHUB_OUTPUT | |
echo "authReactVersionFromWji=${authReactVersionFromWji}" >> $GITHUB_OUTPUT | |
echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT | |
- uses: supertokens/auth-react-testing-action/setup@main | |
id: envs | |
with: | |
auth-react-version: ${{ steps.repo-versions.outputs.authReactVersionFromFdi }} | |
node-sdk-version: ${{ steps.repo-versions.outputs.nodeVersion }} | |
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.repo-versions.outputs.nodeVersion }} | |
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 |