|
| 1 | +name: "Backend SDK 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 | + tags: |
| 14 | + - "(dev-)?v[0-9]+.[0-9]+.[0-9]+" |
| 15 | + |
| 16 | +jobs: |
| 17 | + define-versions: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + outputs: |
| 20 | + fdiVersions: ${{ steps.versions.outputs.fdiVersions }} |
| 21 | + cdiVersions: ${{ steps.versions.outputs.cdiVersions }} |
| 22 | + pyVersions: '["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]' |
| 23 | + nodeVersions: '["20"]' |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - uses: supertokens/get-supported-versions-action@main |
| 27 | + id: versions |
| 28 | + with: |
| 29 | + has-fdi: true |
| 30 | + has-cdi: true |
| 31 | + |
| 32 | + test: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + needs: define-versions |
| 35 | + |
| 36 | + strategy: |
| 37 | + fail-fast: false |
| 38 | + matrix: |
| 39 | + cdi-version: ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }} |
| 40 | + fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }} |
| 41 | + py-version: ${{ fromJson(needs.define-versions.outputs.pyVersions) }} |
| 42 | + node-version: ${{ fromJson(needs.define-versions.outputs.nodeVersions) }} |
| 43 | + |
| 44 | + env: |
| 45 | + API_PORT: 3030 |
| 46 | + SUPERTOKENS_CORE_PORT: 3567 |
| 47 | + SUPERTOKENS_CORE_HOST: localhost |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + with: |
| 52 | + # Checking out to a custom path since the test repo will also be cloned |
| 53 | + path: supertokens-python |
| 54 | + |
| 55 | + - uses: supertokens/get-versions-action@main |
| 56 | + id: versions |
| 57 | + with: |
| 58 | + driver-name: python |
| 59 | + cdi-version: ${{ matrix.cdi-version }} |
| 60 | + fdi-version: ${{ matrix.fdi-version }} |
| 61 | + env: |
| 62 | + SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }} |
| 63 | + |
| 64 | + - uses: actions/setup-node@v4 |
| 65 | + with: |
| 66 | + node-version: ${{ matrix.node-version }} |
| 67 | + |
| 68 | + - name: Create virtual environment and install dependencies |
| 69 | + working-directory: supertokens-python |
| 70 | + # Upgrade `pip` and `setuptools` to have the latest versions before further installs |
| 71 | + run: | |
| 72 | + python3 -m venv venv |
| 73 | + source venv/bin/activate |
| 74 | + python3 -m pip install pip setuptools --upgrade |
| 75 | + make dev-install && rm -rf src |
| 76 | + - name: Start core and server |
| 77 | + working-directory: supertokens-python |
| 78 | + env: |
| 79 | + SUPERTOKENS_ENV: testing |
| 80 | + SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersionXy }} |
| 81 | + run: | |
| 82 | + source venv/bin/activate |
| 83 | + docker compose up --build --wait |
| 84 | + python3 tests/test-server/app.py & |
| 85 | + - uses: supertokens/backend-sdk-testing-action@main |
| 86 | + with: |
| 87 | + # version: ${{ matrix.fdi-version }} |
| 88 | + version: ci/github-actions/containerized-core/${{ matrix.fdi-version }} |
| 89 | + check-name-suffix: '[CDI=${{ matrix.cdi-version }}][Core=${{ steps.versions.outputs.coreVersionXy }}][FDI=${{ matrix.fdi-version }}][Py=${{ matrix.py-version }}][Node=${{ matrix.node-version }}]' |
| 90 | + path: backend-sdk-testing |
0 commit comments