Skip to content

Commit

Permalink
update coverage report locations, remove duplicate filenames (hvac#1024)
Browse files Browse the repository at this point in the history
* update coverage report locations, remove duplicate filenames

* coverage least-privilege

* reduce retention on reports

* least privilege on everything

* restore checkout for codecov.yml contents
  • Loading branch information
briantist authored Jul 2, 2023
1 parent ac144f0 commit ab541ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- main

permissions:
contents: read

jobs:
lint:
name: Lint
Expand Down Expand Up @@ -143,15 +146,16 @@ jobs:
run: |
poetry run pytest \
--cov=hvac \
--cov-report=xml \
--cov-report=xml:reports/coverage_py${{ matrix.python-version }}.xml \
tests/unit_tests
- name: Upload unit tests coverage artifacts
uses: actions/upload-artifact@v3
with:
name: unit_tests-coverage.xml
path: coverage.xml
name: coverage_reports
path: reports/*.xml
if-no-files-found: error
retention-days: 1

integration-tests:
name: Integration Tests
Expand Down Expand Up @@ -215,18 +219,21 @@ jobs:
sudo setcap cap_ipc_lock= /usr/bin/vault
- name: pytest tests/integration_tests
env:
COVFILE: coverage_py${{ matrix.python-version }}_${{ matrix.vault-version }}.xml
run: |
poetry run pytest \
--cov=hvac \
--cov-report=xml \
--cov-report=xml:reports/${COVFILE//[^A-Za-z0-9\-_\.]/_} \
tests/integration_tests
- name: Upload integration tests coverage artifacts
uses: actions/upload-artifact@v3
with:
name: integration_tests-coverage.xml
path: coverage.xml
name: coverage_reports
path: reports/*.xml
if-no-files-found: error
retention-days: 1

upload-to-codecov:
name: Upload to Codecov
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
test/*.log
/.coverage
/cover
/reports
*~

# sphinx build folder
Expand Down

0 comments on commit ab541ac

Please sign in to comment.