diff --git a/.github/workflows/auth-react-test-1.yml b/.github/workflows/auth-react-test-1.yml index f241ff8fb..b2c2604fb 100644 --- a/.github/workflows/auth-react-test-1.yml +++ b/.github/workflows/auth-react-test-1.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/backend-sdk-test.yml b/.github/workflows/backend-sdk-test.yml index 2c409f7c6..bc5512942 100644 --- a/.github/workflows/backend-sdk-test.yml +++ b/.github/workflows/backend-sdk-test.yml @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/.github/workflows/website-test.yml b/.github/workflows/website-test.yml index 760762bf7..e2a893b93 100644 --- a/.github/workflows/website-test.yml +++ b/.github/workflows/website-test.yml @@ -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 @@ -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 @@ -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 @@ -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 }} diff --git a/compose.yml b/compose.yml index 9d01cf43d..762fb2cd7 100644 --- a/compose.yml +++ b/compose.yml @@ -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