mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
Capture coverage of integration tests
To capture the coverage also for the integration tests, a test only executing the cmd.Run function is used. The test always exits with code 0 and prints the real exit code to stdout. Otherwise no coverage report is generated. Those changes enable a more accurate coverage report for future contributions.
This commit is contained in:
@@ -51,10 +51,15 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
|
||||
- name: Get aptly version
|
||||
run: |
|
||||
make version
|
||||
go generate
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
@@ -82,9 +87,9 @@ jobs:
|
||||
with:
|
||||
directory: ${{ runner.temp }}
|
||||
|
||||
- name: Get aptly version
|
||||
- name: Create temp dir
|
||||
run: |
|
||||
make version
|
||||
echo "COVERAGE_DIR=$(mktemp -d)" >> $GITHUB_ENV
|
||||
|
||||
- name: Make
|
||||
env:
|
||||
@@ -95,8 +100,14 @@ jobs:
|
||||
run: |
|
||||
make
|
||||
|
||||
- name: Merge code coverage
|
||||
if: matrix.run_long_tests == 'yes'
|
||||
run: |
|
||||
go install github.com/wadey/gocovmerge@latest
|
||||
~/go/bin/gocovmerge unit.out $COVERAGE_DIR/*.out > coverage.txt
|
||||
|
||||
- name: Upload code coverage
|
||||
if: matrix.run_long_tests
|
||||
if: matrix.run_long_tests == 'yes'
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user