|
| 1 | +name: Auth-React Tests - L3 |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + fdi-version: |
| 6 | + description: "FDI Version for this set of tests" |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + |
| 10 | + matrix: |
| 11 | + description: "Matrix" |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + |
| 15 | + AUTH_REACT__LOG_DIR: |
| 16 | + description: AUTH_REACT__LOG_DIR |
| 17 | + required: true |
| 18 | + type: string |
| 19 | + |
| 20 | + AUTH_REACT__SCREENSHOT_DIR: |
| 21 | + description: AUTH_REACT__SCREENSHOT_DIR |
| 22 | + required: true |
| 23 | + type: string |
| 24 | + |
| 25 | + AUTH_REACT__APP_SERVER: |
| 26 | + description: AUTH_REACT__APP_SERVER |
| 27 | + required: true |
| 28 | + type: string |
| 29 | + |
| 30 | + AUTH_REACT__NODE_PORT: |
| 31 | + description: AUTH_REACT__NODE_PORT |
| 32 | + required: true |
| 33 | + type: string |
| 34 | + |
| 35 | + AUTH_REACT__TEST_MODE: |
| 36 | + description: AUTH_REACT__TEST_MODE |
| 37 | + required: true |
| 38 | + type: string |
| 39 | + |
| 40 | + AUTH_REACT__PORT: |
| 41 | + description: AUTH_REACT__PORT |
| 42 | + required: true |
| 43 | + type: string |
| 44 | + |
| 45 | + |
| 46 | +jobs: |
| 47 | + test: |
| 48 | + if: ${{ inputs.matrix != '{"include":[]}' }} |
| 49 | + runs-on: ubuntu-latest |
| 50 | + strategy: |
| 51 | + max-parallel: 10 |
| 52 | + fail-fast: false # Don't fail fast to avoid locking TF State |
| 53 | + matrix: ${{ fromJson(inputs.matrix) }} |
| 54 | + |
| 55 | + env: |
| 56 | + SUPERTOKENS_CORE_PORT: 3567 |
| 57 | + SUPERTOKENS_CORE_HOST: localhost |
| 58 | + TEST_MODE: testing |
| 59 | + # Auth react setup envs |
| 60 | + AUTH_REACT__LOG_DIR: ${{ inputs.AUTH_REACT__LOG_DIR }} |
| 61 | + AUTH_REACT__SCREENSHOT_DIR: ${{ inputs.AUTH_REACT__SCREENSHOT_DIR }} |
| 62 | + AUTH_REACT__APP_SERVER: ${{ inputs.AUTH_REACT__APP_SERVER }} |
| 63 | + AUTH_REACT__NODE_PORT: ${{ inputs.AUTH_REACT__NODE_PORT }} |
| 64 | + AUTH_REACT__TEST_MODE: ${{ inputs.AUTH_REACT__TEST_MODE }} |
| 65 | + AUTH_REACT__PORT: ${{ inputs.AUTH_REACT__PORT }} |
| 66 | + |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + with: |
| 70 | + path: supertokens-python |
| 71 | + |
| 72 | + - uses: actions/setup-python@v5 |
| 73 | + with: |
| 74 | + python-version: ${{ matrix.py-version }} |
| 75 | + |
| 76 | + - name: Create virtual environment and install dependencies |
| 77 | + working-directory: supertokens-python |
| 78 | + # Upgrade `pip` and `setuptools` to have the latest versions before further installs |
| 79 | + run: | |
| 80 | + python3 -m venv venv |
| 81 | + source venv/bin/activate |
| 82 | + python3 -m pip install pip setuptools --upgrade |
| 83 | + make dev-install && rm -rf src |
| 84 | +
|
| 85 | + - name: Start core |
| 86 | + working-directory: supertokens-python |
| 87 | + run: docker compose up --wait |
| 88 | + |
| 89 | + - name: Start Server (django) |
| 90 | + if: matrix.framework == 'django' |
| 91 | + working-directory: supertokens-python |
| 92 | + run: | |
| 93 | + source venv/bin/activate |
| 94 | + export PYTHONPATH="${PYTHONPATH}:$(pwd)" |
| 95 | + cd tests/auth-react/django3x |
| 96 | +
|
| 97 | + mkdir -p $AUTH_REACT__LOG_DIR |
| 98 | + uvicorn mysite.asgi:application --port 8083 &> $AUTH_REACT__LOG_DIR/django.log & |
| 99 | +
|
| 100 | + - name: Start Server (fastapi) |
| 101 | + if: matrix.framework == 'fastapi' |
| 102 | + working-directory: supertokens-python |
| 103 | + run: | |
| 104 | + source venv/bin/activate |
| 105 | + export PYTHONPATH="${PYTHONPATH}:$(pwd)" |
| 106 | + cd tests/auth-react/fastapi-server |
| 107 | +
|
| 108 | + mkdir -p $AUTH_REACT__LOG_DIR |
| 109 | + uvicorn app:app --host 0.0.0.0 --port 8083 &> $AUTH_REACT__LOG_DIR/fastapi.log & |
| 110 | +
|
| 111 | + - name: Start Server (flask) |
| 112 | + if: matrix.framework == 'flask' |
| 113 | + working-directory: supertokens-python |
| 114 | + run: | |
| 115 | + source venv/bin/activate |
| 116 | + export PYTHONPATH="${PYTHONPATH}:$(pwd)" |
| 117 | + cd tests/auth-react/flask-server |
| 118 | +
|
| 119 | + mkdir -p $AUTH_REACT__LOG_DIR |
| 120 | + python3 app.py --port 8083 &> $AUTH_REACT__LOG_DIR/flask.log & |
| 121 | +
|
| 122 | + - uses: supertokens/auth-react-testing-action@main |
| 123 | + with: |
| 124 | + fdi-version: ${{ inputs.fdi-version }} |
| 125 | + check-name-suffix: '[FDI=${{ inputs.fdi-version }}][Py=${{ matrix.py-version }}][Framework=${{ matrix.framework }}][Spec=${{ matrix.spec }}]' |
| 126 | + path: supertokens-auth-react |
| 127 | + spec: ${{ matrix.spec }} |
0 commit comments