|
| 1 | +name: Shared CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - 'libs/shared/**' |
| 9 | + - 'libs/shared' |
| 10 | + pull_request: |
| 11 | + paths: |
| 12 | + - 'libs/shared/**' |
| 13 | + - 'libs/shared' |
| 14 | + merge_group: |
| 15 | + paths: |
| 16 | + - 'libs/shared/**' |
| 17 | + - 'libs/shared' |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +jobs: |
| 24 | + # TODO: get mypy running |
| 25 | + shared-lint: |
| 26 | + name: Run Lint (Shared) |
| 27 | + uses: codecov/gha-workflows/.github/workflows/lint.yml@pr41 |
| 28 | + with: |
| 29 | + working_directory: libs/shared |
| 30 | + |
| 31 | + shared-codecovstartup: |
| 32 | + name: Codecov Startup (Shared) |
| 33 | + uses: codecov/gha-workflows/.github/workflows/codecov-startup.yml@pr41 |
| 34 | + secrets: inherit |
| 35 | + with: |
| 36 | + working_directory: libs/shared |
| 37 | + |
| 38 | + shared-test: |
| 39 | + name: Test (Shared) |
| 40 | + runs-on: ubuntu-latest |
| 41 | + defaults: |
| 42 | + run: |
| 43 | + working-directory: libs/shared |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + submodules: 'recursive' |
| 49 | + |
| 50 | + - name: Install docker compose |
| 51 | + run: | |
| 52 | + sudo curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose |
| 53 | + sudo chmod +x /usr/local/bin/docker-compose |
| 54 | +
|
| 55 | + - name: Build test environment |
| 56 | + run: | |
| 57 | + make test_env.build |
| 58 | +
|
| 59 | + - name: Bring containers up |
| 60 | + run: | |
| 61 | + make test_env.up |
| 62 | +
|
| 63 | + - name: Run tests |
| 64 | + run: | |
| 65 | + make test_env.test |
| 66 | +
|
| 67 | + # Don't upload on forks for now. |
| 68 | + - name: upload using codecovcli |
| 69 | + if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} |
| 70 | + run: | |
| 71 | + docker-compose exec shared codecovcli -v upload-process -C ${{ github.sha }} --flag shared-docker-uploader --token ${{ secrets.CODECOV_ORG_TOKEN }} --fail-on-error |
| 72 | + docker-compose exec shared codecovcli -v do-upload -C ${{ github.sha }} --report-type "test_results" --flag shared-docker-uploader --token ${{ secrets.CODECOV_ORG_TOKEN }} --fail-on-error |
| 73 | +
|
| 74 | + - name: upload using codecovcli staging |
| 75 | + if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} |
| 76 | + run: | |
| 77 | + docker-compose exec shared codecovcli -v -u ${{ secrets.CODECOV_STAGING_URL }} upload-process -C ${{ github.sha }} --flag shared-docker-uploader --token ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} --fail-on-error |
| 78 | + docker-compose exec shared codecovcli -v -u ${{ secrets.CODECOV_STAGING_URL }} do-upload -C ${{ github.sha }} --report-type "test_results" --flag shared-docker-uploader --token ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} || true |
| 79 | +
|
| 80 | + - name: upload using codecovcli qa |
| 81 | + if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} |
| 82 | + run: | |
| 83 | + docker-compose exec shared codecovcli -v -u ${{ secrets.CODECOV_QA_URL }} upload-process -C ${{ github.sha }} --flag shared-docker-uploader --token ${{ secrets.CODECOV_QA_TOKEN }} --fail-on-error |
| 84 | + docker-compose exec shared codecovcli -v -u ${{ secrets.CODECOV_QA_URL }} do-upload -C ${{ github.sha }} --report-type "test_results" --flag shared-docker-uploader --token ${{ secrets.CODECOV_QA_TOKEN }} --fail-on-error |
| 85 | +
|
| 86 | + - name: upload using codecovcli public qa |
| 87 | + if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} |
| 88 | + run: | |
| 89 | + docker-compose exec shared codecovcli -v -u ${{ secrets.CODECOV_PUBLIC_QA_URL }} upload-process -C ${{ github.sha }} --flag shared-docker-uploader --token ${{ secrets.CODECOV_PUBLIC_QA_TOKEN }} --fail-on-error |
| 90 | + docker-compose exec shared codecovcli -v -u ${{ secrets.CODECOV_PUBLIC_QA_URL }} do-upload -C ${{ github.sha }} --report-type "test_results" --flag shared-docker-uploader --token ${{ secrets.CODECOV_PUBLIC_QA_TOKEN }} || true |
0 commit comments