diff --git a/.github/workflows/auth-react-test-1.yml b/.github/workflows/auth-react-test-1.yml index 4ee5a0a4a..bd5854291 100644 --- a/.github/workflows/auth-react-test-1.yml +++ b/.github/workflows/auth-react-test-1.yml @@ -21,6 +21,8 @@ jobs: runs-on: ubuntu-latest outputs: fdiVersions: ${{ steps.versions.outputs.fdiVersions }} + + nodeFdiVersionMap: ${{ steps.node-versions.outputs.fdiVersions }} steps: - uses: actions/checkout@v4 - uses: supertokens/get-supported-versions-action@main @@ -28,6 +30,13 @@ jobs: with: has-fdi: true + - 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 @@ -45,21 +54,30 @@ jobs: AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }} specs: ${{ steps.envs.outputs.specs }} fdiVersions: ${{ needs.define-versions.outputs.fdiVersions }} + nodeFdiVersionMap: ${{ needs.define-versions.outputs.nodeFdiVersionMap }} steps: - - uses: supertokens/get-versions-action@main - id: versions + - id: repo-versions + run: | + nodeVersion=$( echo '${{ needs.define-versions.outputs.nodeFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' ) + echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT + + # We will use this in the test run to get the core version + - uses: actions/checkout@v4 with: - driver-name: node - fdi-version: ${{ matrix.fdi-version }} - env: - SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }} + repository: supertokens/supertokens-node + ref: ${{ steps.repo-versions.outputs.nodeVersion }} + path: supertokens-node + + # Makes npm use HTTP instead of SSH for installs + - name: Reconfigure git to use HTTP authentication + run: git config --global url."https://github.com/".insteadOf ssh://git@github.com/ - uses: supertokens/auth-react-testing-action/setup@main id: envs with: auth-react-version: ${{ github.sha }} - node-sdk-version: ${{ steps.versions.outputs.nodeTag }} + node-sdk-version: ${{ steps.repo-versions.outputs.nodeVersion }} fdi-version: ${{ matrix.fdi-version }} use-common-app-and-test-server: "true" diff --git a/.github/workflows/auth-react-test-2.yml b/.github/workflows/auth-react-test-2.yml index 37b8c903b..d49d6060f 100644 --- a/.github/workflows/auth-react-test-2.yml +++ b/.github/workflows/auth-react-test-2.yml @@ -65,13 +65,38 @@ jobs: AUTH_REACT__PORT: ${{ inputs.AUTH_REACT__PORT }} steps: - - uses: actions/checkout@v4 + - uses: bissolli/gh-action-persist-workspace@v2 with: - path: supertokens-auth-react + 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/actions/get-versions-from-repo@main + id: core-versions + with: + repo: supertokens-core + github-token: ${{ secrets.GITHUB_TOKEN }} + cdi-versions: ${{ steps.node-cdi-versions.outputs.cdiVersions }} + + - name: Get core version from latest Node CDI version + id: core-version + run: | + lastNodeCdiVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]') | sed -e 's/"/\\"/g' + coreVersion=$(echo '${{ steps.core-versions.outputs.cdiVersions }}' | jq -r ".[$lastNodeCdiVersion]") + + echo "coreVersion=${coreVersion}" >> $GITHUB_OUTPUT - name: Start core run: docker compose up --wait working-directory: supertokens-auth-react + env: + SUPERTOKENS_CORE_VERSION: ${{ steps.core-version.outputs.coreVersion }} - uses: supertokens/auth-react-testing-action@main name: test ${{ matrix.spec }} for ${{ inputs.fdi-version }} @@ -80,3 +105,4 @@ jobs: check-name-suffix: "[FDI=${{ inputs.fdi-version }}][Spec=${{ matrix.spec }}]" path: supertokens-auth-react spec: ${{ matrix.spec }} + retrieve-workspace: false