|
| 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 }} |
0 commit comments