|
| 1 | +name: Run Tests Split |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + run_integration: |
| 7 | + required: false |
| 8 | + type: boolean |
| 9 | + default: true |
| 10 | + repo: |
| 11 | + type: string |
| 12 | + required: true |
| 13 | +env: |
| 14 | + AR_REPO: ${{ inputs.repo }} |
| 15 | + |
| 16 | +jobs: |
| 17 | + test: |
| 18 | + name: Test |
| 19 | + runs-on: ubuntu-latest |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + group: [1, 2, 3, 4, 5] |
| 23 | + steps: |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + fetch-depth: 0 |
| 28 | + - name: Cache App |
| 29 | + id: cache-app |
| 30 | + uses: actions/cache@v4 |
| 31 | + env: |
| 32 | + cache-name: cache-app |
| 33 | + with: |
| 34 | + path: | |
| 35 | + app.tar |
| 36 | + key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.run_id }} |
| 37 | + - name: Load built image |
| 38 | + run: | |
| 39 | + docker load --input app.tar |
| 40 | + - name: Install docker compose |
| 41 | + run: | |
| 42 | + sudo curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose |
| 43 | + sudo chmod +x /usr/local/bin/docker-compose |
| 44 | + - name: Bring test env up |
| 45 | + run: | |
| 46 | + make test_env.up |
| 47 | + - name: Prepare for tests |
| 48 | + run: | |
| 49 | + make test_env.prepare |
| 50 | + make test_env.check_db |
| 51 | + - name: Run unit tests |
| 52 | + run: | |
| 53 | + make test_env.run_unit --group ${{ matrix.group }} |
| 54 | + - name: Run integration tests |
| 55 | + if: inputs.run_integration == true |
| 56 | + run: | |
| 57 | + make test_env.run_integration --group ${{ matrix.group }} |
| 58 | + ## Don't upload on forks for now. |
| 59 | + - name: upload using codecovcli |
| 60 | + if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} |
| 61 | + run: | |
| 62 | + make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_ORG_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_URL }} |
| 63 | + - name: upload using codecovcli staging |
| 64 | + if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} |
| 65 | + run: | |
| 66 | + make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_ORG_TOKEN_STAGING }} CODECOV_URL=${{ secrets.CODECOV_STAGING_URL }} |
| 67 | + - name: upload using codecovcli qa |
| 68 | + if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} |
| 69 | + run: | |
| 70 | + make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_QA_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_QA_URL }} |
| 71 | + - name: upload using codecovcli public qa |
| 72 | + if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} |
| 73 | + run: | |
| 74 | + make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_PUBLIC_QA_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_PUBLIC_QA_URL }} |
0 commit comments