|
| 1 | +name: Million Users Test |
| 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 | + dependency-branches: |
| 18 | + name: Dependency Branches |
| 19 | + runs-on: ubuntu-latest |
| 20 | + outputs: |
| 21 | + branches: ${{ steps.result.outputs.branches }} |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + - uses: supertokens/get-core-dependencies-action@main |
| 26 | + id: result |
| 27 | + with: |
| 28 | + running-for: core |
| 29 | + |
| 30 | + test: |
| 31 | + name: Million Users Test |
| 32 | + needs: dependency-branches |
| 33 | + if: github.event.review.state == 'approved' |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + matrix: |
| 37 | + plugin: |
| 38 | + - postgresql |
| 39 | + - mysql |
| 40 | + |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - name: Set up JDK 15.0.1 |
| 44 | + uses: actions/setup-java@v2 |
| 45 | + with: |
| 46 | + java-version: 15.0.1 |
| 47 | + distribution: zulu |
| 48 | + - uses: actions/checkout@v2 |
| 49 | + with: |
| 50 | + repository: supertokens/supertokens-root |
| 51 | + path: ./supertokens-root |
| 52 | + ref: master |
| 53 | + - uses: actions/checkout@v2 |
| 54 | + with: |
| 55 | + path: ./supertokens-root/supertokens-core |
| 56 | + - uses: actions/checkout@v2 |
| 57 | + with: |
| 58 | + repository: supertokens/supertokens-plugin-interface |
| 59 | + path: ./supertokens-root/supertokens-plugin-interface |
| 60 | + ref: ${{ fromJson(needs.dependency-branches.outputs.branches)['plugin-interface'] }} |
| 61 | + - uses: actions/checkout@v2 |
| 62 | + if: matrix.plugin != 'sqlite' |
| 63 | + with: |
| 64 | + repository: supertokens/supertokens-${{ matrix.plugin }}-plugin |
| 65 | + path: ./supertokens-root/supertokens-${{ matrix.plugin }}-plugin |
| 66 | + ref: ${{ fromJson(needs.dependency-branches.outputs.branches)[matrix.plugin] }} |
| 67 | + - name: Load Modules |
| 68 | + run: | |
| 69 | + cd supertokens-root |
| 70 | + echo "core,master |
| 71 | + plugin-interface,master |
| 72 | + ${{ matrix.plugin }}-plugin,master |
| 73 | + " > modules.txt |
| 74 | + cat modules.txt |
| 75 | + ./loadModules |
| 76 | + - name: Setup test env |
| 77 | + run: cd supertokens-root && ./utils/setupTestEnv --local |
| 78 | + - name: Start ${{ matrix.plugin }} server |
| 79 | + if: matrix.plugin != 'sqlite' |
| 80 | + run: cd supertokens-root/supertokens-${{ matrix.plugin }}-plugin && ./startDb.sh |
| 81 | + - name: Run OAuth Provider |
| 82 | + run: cd supertokens-root && docker run -p 4444:4444 -p 4445:4445 -d --rm --name oauth-cicd rishabhpoddar/oauth-server-cicd && sleep 2 |
| 83 | + - name: Run tests |
| 84 | + env: |
| 85 | + ONE_MILLION_USERS_TEST: 1 |
| 86 | + run: | |
| 87 | + cd supertokens-root |
| 88 | + ./gradlew :supertokens-${{ matrix.plugin }}-plugin:test --tests io.supertokens.storage.${{ matrix.plugin }}.test.OneMillionUsersTest |
| 89 | +
|
| 90 | + - name: Publish Test Report |
| 91 | + uses: mikepenz/action-junit-report@v5 |
| 92 | + if: always() |
| 93 | + with: |
| 94 | + report_paths: '**/build/test-results/test/TEST-*.xml' |
| 95 | + detailed_summary: true |
| 96 | + include_passed: false |
| 97 | + annotate_notice: false |
0 commit comments