Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 25 additions & 8 deletions .github/workflows/auth-react-test-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
nodeVersions: '["20"]'
nodeFdiVersionMap: ${{ steps.node-versions.outputs.fdiVersions }}
authReactFdiVersionMap: ${{ steps.auth-react-versions.outputs.fdiVersions }}
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-supported-versions-action@main
Expand All @@ -34,6 +36,20 @@ jobs:
has-fdi: true
has-cdi: 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 }}

- 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:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
Expand All @@ -54,19 +70,20 @@ jobs:
matrix: ${{ steps.setup-matrix.outputs.matrix }}

steps:
- uses: supertokens/get-versions-action@main
- name: Get node and auth-react versions for FDI
id: versions
with:
driver-name: node
fdi-version: ${{ matrix.fdi-version }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
run: |
nodeVersion=$( echo '${{ needs.define-versions.outputs.nodeFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' )
authReactVersion=$( echo '${{ needs.define-versions.outputs.authReactFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' )

echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT
echo "authReactVersion=${authReactVersion}" >> $GITHUB_OUTPUT

- uses: supertokens/auth-react-testing-action/setup@main
id: envs
with:
auth-react-version: ${{ steps.versions.outputs.authReactVersionXy }}
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
auth-react-version: ${{ steps.versions.outputs.authReactVersion }}
node-sdk-version: ${{ steps.versions.outputs.nodeVersion }}
fdi-version: ${{ matrix.fdi-version }}

- id: setup-matrix
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/backend-sdk-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
nodeVersions: '["20"]'
coreCdiVersionMap: ${{ steps.core-versions.outputs.cdiVersions }}
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-supported-versions-action@main
Expand All @@ -34,6 +35,13 @@ jobs:
has-fdi: true
has-cdi: true

- uses: supertokens/actions/get-versions-from-repo@main
id: core-versions
with:
repo: supertokens-core
github-token: ${{ secrets.GITHUB_TOKEN }}
cdi-versions: ${{steps.versions.outputs.cdiVersions }}

test:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
Expand All @@ -57,14 +65,12 @@ jobs:
# Checking out to a custom path since the test repo will also be cloned
path: supertokens-node

- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: node
cdi-version: ${{ matrix.cdi-version }}
fdi-version: ${{ matrix.fdi-version }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
- name: Get core version from current CDI version
id: core-version
run: |
coreVersion=$(echo '${{ needs.define-versions.outputs.coreCdiVersionMap }}' | jq -r '.["${{ matrix.cdi-version }}"]')

echo "coreVersion=${coreVersion}" >> $GITHUB_OUTPUT

- uses: actions/setup-node@v4
with:
Expand All @@ -74,7 +80,7 @@ jobs:
working-directory: supertokens-node
run: docker compose up --build --wait
env:
SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersionXy }}
SUPERTOKENS_CORE_VERSION: ${{ steps.core-version.outputs.coreVersion }}

- name: Install SDK dependencies
working-directory: supertokens-node
Expand Down
46 changes: 38 additions & 8 deletions .github/workflows/website-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
nodeVersions: '["20"]'
nodeFdiVersionMap: ${{ steps.node-versions.outputs.fdiVersions }}
websiteFdiVersionMap: ${{ steps.website-versions.outputs.fdiVersions }}
coreCdiVersionMap: ${{ steps.core-versions.outputs.cdiVersions }}
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-supported-versions-action@main
Expand All @@ -34,6 +37,27 @@ jobs:
has-fdi: true
has-cdi: true

- uses: supertokens/actions/get-versions-from-repo@main
id: website-versions
with:
repo: supertokens-website
github-token: ${{ secrets.GITHUB_TOKEN }}
fdi-versions: ${{ steps.versions.outputs.fdiVersions }}

- 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 }}

- uses: supertokens/actions/get-versions-from-repo@main
id: core-versions
with:
repo: supertokens-core
github-token: ${{ secrets.GITHUB_TOKEN }}
cdi-versions: ${{steps.versions.outputs.cdiVersions }}

test:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
runs-on: ubuntu-latest
Expand Down Expand Up @@ -61,16 +85,22 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- uses: supertokens/get-versions-action@main
- name: Get versions from current FDI/CDI version
id: versions
with:
driver-name: python
fdi-version: ${{ matrix.fdi-version }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
run: |
latestCdiVersion=$(echo '${{ needs.define-versions.outputs.cdiVersions }}' | jq -r '.[-1]' | sed -e 's/"/\\"/g')
coreVersion=$(echo '${{ needs.define-versions.outputs.coreCdiVersionMap }}' | jq -r ".[\"$latestCdiVersion\"]")
nodeVersion=$(echo '${{ needs.define-versions.outputs.nodeFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]')
websiteVersion=$(echo '${{ needs.define-versions.outputs.websiteFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]')

echo "coreVersion=${coreVersion}" >> $GITHUB_OUTPUT
echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT
echo "websiteVersion=${websiteVersion}" >> $GITHUB_OUTPUT

- name: Start core
working-directory: supertokens-node
env:
SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersion }}
run: docker compose up --wait

- name: Install SDK dependencies
Expand All @@ -89,8 +119,8 @@ jobs:

- uses: supertokens/website-testing-action@main
with:
version: ${{ steps.versions.outputs.frontendVersionXy }}
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
version: ${{ steps.versions.outputs.websiteVersion }}
node-sdk-version: ${{ steps.versions.outputs.nodeVersion }}
path: supertokens-website
check-name-suffix: "[Node=${{ matrix.node-version }}][FDI=${{ matrix.fdi-version }}]"
app-server-logs: ${{ steps.envs.outputs.APP_SERVER_LOG_DIR }}
7 changes: 6 additions & 1 deletion compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
services:
core:
# Uses `$SUPERTOKENS_CORE_VERSION` when available, else latest
image: supertokens/supertokens-core:dev-branch-${SUPERTOKENS_CORE_VERSION:-master}
image: supertokens/supertokens-dev-postgresql:${SUPERTOKENS_CORE_VERSION:-master}
# entrypoint: [
# "/usr/lib/supertokens/jre/bin/java",
# "-classpath", "/usr/lib/supertokens/core/*:/usr/lib/supertokens/plugin-interface/*:/usr/lib/supertokens/ee/*",
# "io.supertokens.Main", "/usr/lib/supertokens/", "DEV", "test_mode"
# ]
ports:
# Uses `$SUPERTOKENS_CORE_PORT` when available, else 3567 for local port
- ${SUPERTOKENS_CORE_PORT:-3567}:3567
Expand Down
Loading