Skip to content

ci: auth-react

ci: auth-react #10

Workflow file for this run

name: Auth-React Tests
on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- master
- "v[0-9]+.[0-9]+"
tags:
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
jobs:
define-versions:
runs-on: ubuntu-latest
outputs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
pyVersions: '["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]'
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-supported-versions-action@main
id: versions
with:
has-fdi: true
has-cdi: true
test:
runs-on: ubuntu-latest
needs: define-versions
strategy:
fail-fast: false
matrix:
# fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }}
fdi-version: ['4.0']
py-version: ${{ fromJSON(needs.define-versions.outputs.pyVersions) }}
framework:
- django
- fastapi
- flask
env:
SUPERTOKENS_CORE_PORT: 3567
SUPERTOKENS_CORE_HOST: localhost
TEST_MODE: testing
steps:
- uses: actions/checkout@v4
with:
path: supertokens-python
- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: python
fdi-version: ${{ matrix.fdi-version }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py-version }}
- name: Create virtual environment and install dependencies
working-directory: supertokens-python
# Upgrade `pip` and `setuptools` to have the latest versions before further installs
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install pip setuptools --upgrade
make dev-install && rm -rf src
- name: Start core
working-directory: supertokens-python
run: docker compose up --wait
- name: Start Server (django)
if: matrix.framework == 'django'
working-directory: supertokens-python
run: |
source venv/bin/activate
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
cd tests/auth-react/django3x
uvicorn mysite.asgi:application --port 8083 &> output.log &
- name: Start Server (fastapi)
if: matrix.framework == 'fastapi'
working-directory: supertokens-python
run: |
source venv/bin/activate
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
cd tests/auth-react/fastapi-server
uvicorn app:app --host 0.0.0.0 --port 8083 &> output.log &
- name: Start Server (flask)
if: matrix.framework == 'flask'
working-directory: supertokens-python
run: |
source venv/bin/activate
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
cd tests/auth-react/flask-server
python3 app.py --port 8083 &> output.log &
- uses: supertokens/auth-react-testing-action@main
with:
# auth-react-version: ${{ steps.versions.outputs.authReactTag }}
auth-react-version: ci/github-actions/auth-react/v0.48.0
node-version: ${{ steps.versions.outputs.nodeTag }}
check-name-suffix: '[FDI=${{ matrix.fdi-version }}][Core=${{ steps.versions.outputs.coreVersionXy }}][Py=${{ matrix.py-version }}][Node=${{ steps.versions.outputs.nodeTag }}][AuthReact=${{ steps.versions.outputs.authReactTag }}]'
path: supertokens-auth-react