Skip to content

Commit

Permalink
Merge pull request #39 from codecov/Ajay/create-split-test-workflow
Browse files Browse the repository at this point in the history
dev: Create split test workflow for suites using pytest-split
  • Loading branch information
ajay-sentry authored Feb 12, 2025
2 parents d4e52aa + 8a89d6c commit dc48c20
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/run-tests-split.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Run Tests Split

on:
workflow_call:
inputs:
run_integration:
required: false
type: boolean
default: true
repo:
type: string
required: true
env:
AR_REPO: ${{ inputs.repo }}

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
group: [1, 2, 3, 4, 5]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache App
id: cache-app
uses: actions/cache@v4
env:
cache-name: cache-app
with:
path: |
app.tar
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.run_id }}
- name: Load built image
run: |
docker load --input app.tar
- name: Install docker compose
run: |
sudo curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Bring test env up
run: |
make test_env.up
- name: Prepare for tests
run: |
make test_env.prepare
make test_env.check_db
- name: Run unit tests
run: |
make test_env.run_unit --group ${{ matrix.group }}
- name: Run integration tests
if: inputs.run_integration == true
run: |
make test_env.run_integration --group ${{ matrix.group }}
## Don't upload on forks for now.
- name: upload using codecovcli
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_ORG_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_URL }}
- name: upload using codecovcli staging
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_ORG_TOKEN_STAGING }} CODECOV_URL=${{ secrets.CODECOV_STAGING_URL }}
- name: upload using codecovcli qa
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_QA_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_QA_URL }}
- name: upload using codecovcli public qa
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_PUBLIC_QA_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_PUBLIC_QA_URL }}

0 comments on commit dc48c20

Please sign in to comment.