Skip to content

Commit 3c77a8c

Browse files
Add workflow and docker compose file for runs
1 parent c9e289e commit 3c77a8c

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Auth-React Tests
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
push:
10+
branches:
11+
- master
12+
- "v[0-9]+.[0-9]+"
13+
- "ci/github-actions/auth-react/v0.48.0" # TODO: Remove this
14+
tags:
15+
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
16+
17+
jobs:
18+
define-versions:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: supertokens/get-supported-versions-action@main
25+
id: versions
26+
with:
27+
has-fdi: true
28+
29+
setup-auth-react:
30+
runs-on: ubuntu-latest
31+
needs: define-versions
32+
strategy:
33+
fail-fast: true
34+
matrix:
35+
# fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }}
36+
fdi-version: ["4.0"]
37+
38+
outputs:
39+
AUTH_REACT__LOG_DIR: ${{ steps.envs.outputs.AUTH_REACT__LOG_DIR }}
40+
AUTH_REACT__SCREENSHOT_DIR: ${{ steps.envs.outputs.AUTH_REACT__SCREENSHOT_DIR }}
41+
AUTH_REACT__NODE_PORT: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
42+
AUTH_REACT__APP_SERVER: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
43+
AUTH_REACT__TEST_MODE: ${{ steps.envs.outputs.AUTH_REACT__TEST_MODE }}
44+
AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }}
45+
specs: ${{ steps.envs.outputs.specs }}
46+
47+
steps:
48+
- uses: supertokens/get-versions-action@main
49+
id: versions
50+
with:
51+
driver-name: node
52+
fdi-version: ${{ matrix.fdi-version }}
53+
env:
54+
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
55+
56+
- uses: supertokens/auth-react-testing-action/setup@main
57+
id: envs
58+
with:
59+
# auth-react-version: ${{ steps.versions.outputs.authReactTag }}
60+
auth-react-version: ci/github-actions/auth-react/v0.49.0
61+
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
62+
fdi-version: ${{ matrix.fdi-version }}
63+
use-common-app-and-test-server: "true"
64+
65+
test:
66+
runs-on: ubuntu-latest
67+
needs: setup-auth-react
68+
69+
strategy:
70+
max-parallel: 10
71+
fail-fast: false
72+
matrix:
73+
# fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }}
74+
fdi-version: ["4.0"]
75+
spec: ${{ fromJSON(needs.setup-auth-react.outputs.specs) }}
76+
77+
env:
78+
SUPERTOKENS_CORE_PORT: 3567
79+
SUPERTOKENS_CORE_HOST: localhost
80+
TEST_MODE: testing
81+
# Auth react setup envs
82+
AUTH_REACT__LOG_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__LOG_DIR }}
83+
AUTH_REACT__SCREENSHOT_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__SCREENSHOT_DIR }}
84+
AUTH_REACT__NODE_PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__NODE_PORT }}
85+
AUTH_REACT__APP_SERVER: ${{ needs.setup-auth-react.outputs.AUTH_REACT__NODE_PORT }}
86+
AUTH_REACT__TEST_MODE: ${{ needs.setup-auth-react.outputs.AUTH_REACT__TEST_MODE }}
87+
AUTH_REACT__PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__PORT }}
88+
89+
steps:
90+
- uses: actions/checkout@v4
91+
with:
92+
path: supertokens-auth-react
93+
94+
- name: Start core
95+
run: docker compose up --wait
96+
working-directory: supertokens-auth-react
97+
98+
- uses: supertokens/auth-react-testing-action@main
99+
name: test ${{ matrix.spec }} for ${{ matrix.fdi-version }}
100+
with:
101+
fdi-version: ${{ matrix.fdi-version }}
102+
check-name-suffix: "[FDI=${{ matrix.fdi-version }}][Spec=${{ matrix.spec }}]"
103+
path: supertokens-auth-react
104+
spec: ${{ matrix.spec }}

compose.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
services:
2+
core:
3+
# Uses `$SUPERTOKENS_CORE_VERSION` when available, else latest
4+
image: supertokens/supertokens-core:dev-branch-${SUPERTOKENS_CORE_VERSION:-master}
5+
ports:
6+
# Uses `$SUPERTOKENS_CORE_PORT` when available, else 3567 for local port
7+
- ${SUPERTOKENS_CORE_PORT:-3567}:3567
8+
platform: linux/amd64
9+
depends_on: [oauth]
10+
environment:
11+
OAUTH_PROVIDER_PUBLIC_SERVICE_URL: http://oauth:4444
12+
OAUTH_PROVIDER_ADMIN_SERVICE_URL: http://oauth:4445
13+
OAUTH_PROVIDER_CONSENT_LOGIN_BASE_URL: http://localhost:3001/auth
14+
OAUTH_CLIENT_SECRET_ENCRYPTION_KEY: asdfasdfasdfasdfasdf
15+
healthcheck:
16+
test: bash -c 'curl -s "http://127.0.0.1:3567/hello" | grep "Hello"'
17+
interval: 10s
18+
timeout: 5s
19+
retries: 5
20+
21+
oauth:
22+
image: supertokens/oauth2-test:latest
23+
platform: linux/amd64

0 commit comments

Comments
 (0)