summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorSviatoslav Sydorenko (Святослав Сидоренко) <wk@sydorenko.org.ua>2024-09-13 16:46:48 +0200
committerGitHub <noreply@github.com>2024-09-13 16:46:48 +0200
commit090511e65b726d16d0d0221116dde1d52eb32abd (patch)
treed2bc39e02480d1f15db2ee695fdd2049a98044e8 /.github
parentfix: avoid race conditions when removing multiple instance (#15495) (diff)
downloadawx-090511e65b726d16d0d0221116dde1d52eb32abd.tar.xz
awx-090511e65b726d16d0d0221116dde1d52eb32abd.zip
🧪 Gather coverage @ CI and upload to Codecov (#15499)
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml46
1 files changed, 44 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0e67e24afa..71bbda4c5d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -5,6 +5,7 @@ env:
CI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEV_DOCKER_OWNER: ${{ github.repository_owner }}
COMPOSE_TAG: ${{ github.base_ref || 'devel' }}
+ UPSTREAM_REPOSITORY_ID: 91594105
on:
pull_request:
jobs:
@@ -20,7 +21,7 @@ jobs:
matrix:
tests:
- name: api-test
- command: /start_tests.sh
+ command: /start_tests.sh test_coverage
- name: api-migrations
command: /start_tests.sh test_migrations
- name: api-lint
@@ -43,7 +44,48 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run check ${{ matrix.tests.name }}
- run: AWX_DOCKER_CMD='${{ matrix.tests.command }}' make docker-runner
+ id: make-run
+ run: >-
+ AWX_DOCKER_ARGS='-e GITHUB_ACTIONS -e GITHUB_OUTPUT -v "${GITHUB_OUTPUT}:${GITHUB_OUTPUT}:rw,Z"'
+ AWX_DOCKER_CMD='${{ matrix.tests.command }}'
+ make docker-runner
+
+ - name: Upload test coverage to Codecov
+ if: >-
+ !cancelled()
+ && matrix.tests.name == 'api-test'
+ && steps.make-run.outputs.cov-report-files != ''
+ uses: codecov/codecov-action@v4
+ with:
+ fail_ci_if_error: >-
+ ${{
+ toJSON(env.UPSTREAM_REPOSITORY_ID == github.repository_id)
+ }}
+ flags: >-
+ CI-GHA,
+ pytest,
+ OS-${{
+ runner.os
+ }}
+ token: ${{ secrets.CODECOV_TOKEN }}
+ - name: Upload test results to Codecov
+ if: >-
+ !cancelled()
+ && matrix.tests.name == 'api-test'
+ && steps.make-run.outputs.test-result-files != ''
+ uses: codecov/test-results-action@v1
+ with:
+ fail_ci_if_error: >-
+ ${{
+ toJSON(env.UPSTREAM_REPOSITORY_ID == github.repository_id)
+ }}
+ flags: >-
+ CI-GHA,
+ pytest,
+ OS-${{
+ runner.os
+ }}
+ token: ${{ secrets.CODECOV_TOKEN }}
dev-env:
runs-on: ubuntu-latest