mirror of
https://github.com/ansible/awx.git
synced 2026-01-31 17:18:59 -03:30
🧪 Upload ansible-test coverage to Codecov (#15527)
This commit is contained in:
committed by
GitHub
parent
eccc32cbad
commit
cf25a09323
66
.github/workflows/ci.yml
vendored
66
.github/workflows/ci.yml
vendored
@@ -210,8 +210,50 @@ jobs:
|
||||
run: python3 -m pip install --upgrade ansible-core
|
||||
|
||||
- name: Run sanity tests
|
||||
id: make-run
|
||||
run: make test_collection_sanity
|
||||
|
||||
- name: Upload test coverage to Codecov
|
||||
if: >-
|
||||
!cancelled()
|
||||
&& 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)
|
||||
}}
|
||||
files: >-
|
||||
${{ steps.make-run.outputs.cov-report-files }}
|
||||
flags: >-
|
||||
CI-GHA,
|
||||
ansible-test,
|
||||
sanity,
|
||||
OS-${{
|
||||
runner.os
|
||||
}}
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
- name: Upload test results to Codecov
|
||||
if: >-
|
||||
!cancelled()
|
||||
&& 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)
|
||||
}}
|
||||
files: >-
|
||||
${{ steps.make-run.outputs.test-result-files }}
|
||||
flags: >-
|
||||
CI-GHA,
|
||||
ansible-test,
|
||||
sanity,
|
||||
OS-${{
|
||||
runner.os
|
||||
}}
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
collection-integration:
|
||||
name: awx_collection integration
|
||||
runs-on: ubuntu-latest
|
||||
@@ -243,6 +285,7 @@ jobs:
|
||||
python3 -m pip install -r awx_collection/requirements.txt
|
||||
|
||||
- name: Run integration tests
|
||||
id: make-run
|
||||
run: |
|
||||
echo "::remove-matcher owner=python::" # Disable annoying annotations from setup-python
|
||||
echo '[general]' > ~/.tower_cli.cfg
|
||||
@@ -250,10 +293,31 @@ jobs:
|
||||
echo 'oauth_token = ${{ steps.awx.outputs.admin-token }}' >> ~/.tower_cli.cfg
|
||||
echo 'verify_ssl = false' >> ~/.tower_cli.cfg
|
||||
TARGETS="$(ls awx_collection/tests/integration/targets | grep '${{ matrix.target-regex.regex }}' | tr '\n' ' ')"
|
||||
make COLLECTION_VERSION=100.100.100-git COLLECTION_TEST_TARGET="--coverage --requirements $TARGETS" test_collection_integration
|
||||
make COLLECTION_VERSION=100.100.100-git COLLECTION_TEST_TARGET="--requirements $TARGETS" test_collection_integration
|
||||
env:
|
||||
ANSIBLE_TEST_PREFER_PODMAN: 1
|
||||
|
||||
- name: Upload test coverage to Codecov
|
||||
if: >-
|
||||
!cancelled()
|
||||
&& 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)
|
||||
}}
|
||||
files: >-
|
||||
${{ steps.make-run.outputs.cov-report-files }}
|
||||
flags: >-
|
||||
CI-GHA,
|
||||
ansible-test,
|
||||
integration,
|
||||
OS-${{
|
||||
runner.os
|
||||
}}
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
# Upload coverage report as artifact
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
|
||||
Reference in New Issue
Block a user