Skip to content

Commit 2512508

Browse files
namsnathporcellus
andauthored
update: use new get-versions-from-repo action (#913)
* update: use new get-versions-from-repo action in auth-react * fix: npm install issues with auth-react setup action - `web-js` dependency does not specify http/ssh - `npm` uses ssh by default which fails with a key error * fix: retrieve workspace manually * fix: directory --------- Co-authored-by: Mihály Lengyel <[email protected]>
1 parent f5d64ce commit 2512508

File tree

2 files changed

+53
-9
lines changed

2 files changed

+53
-9
lines changed

.github/workflows/auth-react-test-1.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,22 @@ jobs:
2121
runs-on: ubuntu-latest
2222
outputs:
2323
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
24+
25+
nodeFdiVersionMap: ${{ steps.node-versions.outputs.fdiVersions }}
2426
steps:
2527
- uses: actions/checkout@v4
2628
- uses: supertokens/get-supported-versions-action@main
2729
id: versions
2830
with:
2931
has-fdi: true
3032

33+
- uses: supertokens/actions/get-versions-from-repo@main
34+
id: node-versions
35+
with:
36+
repo: supertokens-node
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
fdi-versions: ${{ steps.versions.outputs.fdiVersions }}
39+
3140
setup-auth-react:
3241
runs-on: ubuntu-latest
3342
needs: define-versions
@@ -45,21 +54,30 @@ jobs:
4554
AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }}
4655
specs: ${{ steps.envs.outputs.specs }}
4756
fdiVersions: ${{ needs.define-versions.outputs.fdiVersions }}
57+
nodeFdiVersionMap: ${{ needs.define-versions.outputs.nodeFdiVersionMap }}
4858

4959
steps:
50-
- uses: supertokens/get-versions-action@main
51-
id: versions
60+
- id: repo-versions
61+
run: |
62+
nodeVersion=$( echo '${{ needs.define-versions.outputs.nodeFdiVersionMap }}' | jq -r '.["${{ matrix.fdi-version }}"]' )
63+
echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT
64+
65+
# We will use this in the test run to get the core version
66+
- uses: actions/checkout@v4
5267
with:
53-
driver-name: node
54-
fdi-version: ${{ matrix.fdi-version }}
55-
env:
56-
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
68+
repository: supertokens/supertokens-node
69+
ref: ${{ steps.repo-versions.outputs.nodeVersion }}
70+
path: supertokens-node
71+
72+
# Makes npm use HTTP instead of SSH for installs
73+
- name: Reconfigure git to use HTTP authentication
74+
run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
5775

5876
- uses: supertokens/auth-react-testing-action/setup@main
5977
id: envs
6078
with:
6179
auth-react-version: ${{ github.sha }}
62-
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
80+
node-sdk-version: ${{ steps.repo-versions.outputs.nodeVersion }}
6381
fdi-version: ${{ matrix.fdi-version }}
6482
use-common-app-and-test-server: "true"
6583

.github/workflows/auth-react-test-2.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,38 @@ jobs:
6565
AUTH_REACT__PORT: ${{ inputs.AUTH_REACT__PORT }}
6666

6767
steps:
68-
- uses: actions/checkout@v4
68+
- uses: bissolli/gh-action-persist-workspace@v2
6969
with:
70-
path: supertokens-auth-react
70+
action: retrieve
71+
artifactName: auth-react-${{ inputs.fdi-version }}
72+
73+
- name: Get Node CDI versions
74+
id: node-cdi-versions
75+
uses: supertokens/get-supported-versions-action@main
76+
with:
77+
has-cdi: true
78+
working-directory: supertokens-node
79+
80+
- uses: supertokens/actions/get-versions-from-repo@main
81+
id: core-versions
82+
with:
83+
repo: supertokens-core
84+
github-token: ${{ secrets.GITHUB_TOKEN }}
85+
cdi-versions: ${{ steps.node-cdi-versions.outputs.cdiVersions }}
86+
87+
- name: Get core version from latest Node CDI version
88+
id: core-version
89+
run: |
90+
lastNodeCdiVersion=$(echo '${{ steps.node-cdi-versions.outputs.cdiVersions }}' | jq -r '.[-1]') | sed -e 's/"/\\"/g'
91+
coreVersion=$(echo '${{ steps.core-versions.outputs.cdiVersions }}' | jq -r ".[$lastNodeCdiVersion]")
92+
93+
echo "coreVersion=${coreVersion}" >> $GITHUB_OUTPUT
7194
7295
- name: Start core
7396
run: docker compose up --wait
7497
working-directory: supertokens-auth-react
98+
env:
99+
SUPERTOKENS_CORE_VERSION: ${{ steps.core-version.outputs.coreVersion }}
75100

76101
- uses: supertokens/auth-react-testing-action@main
77102
name: test ${{ matrix.spec }} for ${{ inputs.fdi-version }}
@@ -80,3 +105,4 @@ jobs:
80105
check-name-suffix: "[FDI=${{ inputs.fdi-version }}][Spec=${{ matrix.spec }}]"
81106
path: supertokens-auth-react
82107
spec: ${{ matrix.spec }}
108+
retrieve-workspace: false

0 commit comments

Comments
 (0)