|
| 1 | +name: Auth-React Tests - L1 |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - opened |
| 7 | + - reopened |
| 8 | + - synchronize |
| 9 | + push: |
| 10 | + tags: |
| 11 | + - dev-v[0-9]+.[0-9]+.[0-9]+ |
| 12 | + |
| 13 | +jobs: |
| 14 | + define-versions: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + fdiVersions: ${{ steps.versions.outputs.fdiVersions }} |
| 18 | + webJsInterfaceVersion: ${{ steps.versions.outputs.webJsInterfaceVersion }} |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - uses: supertokens/get-supported-versions-action@main |
| 23 | + id: versions |
| 24 | + with: |
| 25 | + has-fdi: true |
| 26 | + has-web-js: true |
| 27 | + |
| 28 | + setup-auth-react: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + needs: define-versions |
| 31 | + strategy: |
| 32 | + fail-fast: true |
| 33 | + matrix: |
| 34 | + fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }} |
| 35 | + |
| 36 | + outputs: |
| 37 | + AUTH_REACT__LOG_DIR: ${{ steps.envs.outputs.AUTH_REACT__LOG_DIR }} |
| 38 | + AUTH_REACT__SCREENSHOT_DIR: ${{ steps.envs.outputs.AUTH_REACT__SCREENSHOT_DIR }} |
| 39 | + AUTH_REACT__NODE_PORT: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }} |
| 40 | + AUTH_REACT__APP_SERVER: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }} |
| 41 | + AUTH_REACT__TEST_MODE: ${{ steps.envs.outputs.AUTH_REACT__TEST_MODE }} |
| 42 | + AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }} |
| 43 | + specs: ${{ steps.envs.outputs.specs }} |
| 44 | + fdiVersions: ${{ needs.define-versions.outputs.fdiVersions }} |
| 45 | + |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + with: |
| 49 | + path: supertokens-web-js |
| 50 | + |
| 51 | + - uses: supertokens/get-versions-action@main |
| 52 | + id: versions |
| 53 | + with: |
| 54 | + driver-name: node |
| 55 | + fdi-version: ${{ matrix.fdi-version }} |
| 56 | + web-js-interface-version: ${{ needs.define-versions.outputs.webJsInterfaceVersion }} |
| 57 | + env: |
| 58 | + SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }} |
| 59 | + |
| 60 | + - uses: supertokens/auth-react-testing-action/setup@main |
| 61 | + id: envs |
| 62 | + with: |
| 63 | + auth-react-version: ${{ steps.versions.outputs.webJsReactTag }} |
| 64 | + node-sdk-version: ${{ steps.versions.outputs.nodeTag }} |
| 65 | + fdi-version: ${{ matrix.fdi-version }} |
| 66 | + use-common-app-and-test-server: "true" |
| 67 | + persist-workspace: "false" |
| 68 | + |
| 69 | + # We will use this in the test run to get the core version |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + with: |
| 72 | + repository: supertokens/supertokens-node |
| 73 | + ref: ${{ steps.versions.outputs.nodeTag }} |
| 74 | + path: supertokens-node |
| 75 | + |
| 76 | + - name: Copy over required dependencies |
| 77 | + run: | |
| 78 | + cd supertokens-web-js |
| 79 | + # Create a tarball of the web-js package |
| 80 | + npm pack |
| 81 | +
|
| 82 | + cd ../supertokens-auth-react |
| 83 | + # Extract the tarball to the auth-react package |
| 84 | + tar -xf ../supertokens-web-js/supertokens-web-js-*.tgz --strip-components=1 -C node_modules/supertokens-web-js |
| 85 | + # Remove existing website package and link to the one from web-js |
| 86 | + rm -rf node_modules/supertokens-website |
| 87 | + ln -s "$PWD/../supertokens-web-js/node_modules/supertokens-website" node_modules |
| 88 | +
|
| 89 | + # - name: Set up auth-react with new dependencies |
| 90 | + # working-directory: supertokens-auth-react/examples/for-tests |
| 91 | + # env: |
| 92 | + # # Common |
| 93 | + # APP_SERVER: ${{ steps.envs.outputs.AUTH_REACT__APP_SERVER }} |
| 94 | + # NODE_PORT: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }} |
| 95 | + # TEST_MODE: ${{ steps.envs.outputs.AUTH_REACT__TEST_MODE }} |
| 96 | + # # Step-specific |
| 97 | + # CI: true |
| 98 | + # BROWSER: none |
| 99 | + # PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }} |
| 100 | + # REACT_APP_API_PORT: ${{ steps.envs.outputs.AUTH_REACT__APP_SERVER }} |
| 101 | + # run: | |
| 102 | + # npm i |
| 103 | + # npm run prep |
| 104 | + |
| 105 | + - uses: bissolli/gh-action-persist-workspace@v2 |
| 106 | + with: |
| 107 | + action: persist |
| 108 | + artifactName: auth-react-${{ matrix.fdi-version }} |
| 109 | + |
| 110 | + launch-test-workflow: |
| 111 | + uses: ./.github/workflows/auth-react-test-2.yml |
| 112 | + needs: setup-auth-react |
| 113 | + name: FDI ${{ matrix.fdi-version }} |
| 114 | + strategy: |
| 115 | + max-parallel: 1 # This is important to avoid ddos GHA API |
| 116 | + fail-fast: false # Don't fail fast to avoid locking TF State |
| 117 | + matrix: |
| 118 | + fdi-version: ${{ fromJSON(needs.setup-auth-react.outputs.fdiVersions) }} |
| 119 | + with: |
| 120 | + fdi-version: ${{ matrix.fdi-version }} |
| 121 | + specs: ${{ needs.setup-auth-react.outputs.specs }} |
| 122 | + AUTH_REACT__LOG_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__LOG_DIR }} |
| 123 | + AUTH_REACT__SCREENSHOT_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__SCREENSHOT_DIR }} |
| 124 | + AUTH_REACT__APP_SERVER: ${{ needs.setup-auth-react.outputs.AUTH_REACT__APP_SERVER }} |
| 125 | + AUTH_REACT__NODE_PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__NODE_PORT }} |
| 126 | + AUTH_REACT__TEST_MODE: ${{ needs.setup-auth-react.outputs.AUTH_REACT__TEST_MODE }} |
| 127 | + AUTH_REACT__PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__PORT }} |
0 commit comments