|
38 | 38 | PBM_BRANCH: ${{ github.event.inputs.pbm_branch || 'main' }}
|
39 | 39 | GO_VER: ${{ github.event.inputs.go_ver || '1.22-bullseye' }}
|
40 | 40 | PR_NUMBER: ${{ github.event.number|| github.event.inputs.pr_ver }}
|
41 |
| - |
| 41 | + MAKE_TARGET: 'build-cover' |
42 | 42 | steps:
|
43 | 43 | - name: Checkout testing repo
|
44 | 44 | uses: actions/checkout@v4
|
|
58 | 58 | docker compose run test pytest -s --junitxml=junit.xml -k ${{ matrix.test }}
|
59 | 59 | working-directory: psmdb-testing/pbm-functional/pytest
|
60 | 60 |
|
| 61 | + - name: Fetch coverage files |
| 62 | + run: | |
| 63 | + docker compose run --rm golang_reports cp -r /gocoverdir/reports /test |
| 64 | + sudo chmod -R 777 reports |
| 65 | + working-directory: psmdb-testing/pbm-functional/pytest |
| 66 | + if: success() || failure() |
| 67 | + |
| 68 | + - name: Upload coverage reports |
| 69 | + uses: actions/upload-artifact@v4 |
| 70 | + with: |
| 71 | + name: reports-${{ matrix.test }}-${{ matrix.psmdb }} |
| 72 | + path: psmdb-testing/pbm-functional/pytest/reports/ |
| 73 | + if: success() || failure() |
| 74 | + |
61 | 75 | - name: Publish Test Report
|
62 | 76 | uses: mikepenz/action-junit-report@v4
|
63 | 77 | if: success() || failure()
|
64 | 78 | with:
|
65 | 79 | report_paths: "**/junit.xml"
|
| 80 | + |
| 81 | + coverage: |
| 82 | + if: ${{ always() }} |
| 83 | + needs: test |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v4 |
| 87 | + - name: Set up Go |
| 88 | + uses: actions/setup-go@v5 |
| 89 | + with: |
| 90 | + go-version-file: 'go.mod' |
| 91 | + check-latest: true |
| 92 | + - name: Download all coverage reports |
| 93 | + uses: actions/download-artifact@v4 |
| 94 | + with: |
| 95 | + path: reports |
| 96 | + pattern: reports-* |
| 97 | + merge-multiple: true |
| 98 | + - name: Merge coverage reports |
| 99 | + run: | |
| 100 | + go tool covdata textfmt -i=./reports -o ./coverage.txt |
| 101 | + - name: Upload coverage to Codecov |
| 102 | + uses: codecov/codecov-action@v3 |
| 103 | + with: |
| 104 | + files: ./coverage.txt |
| 105 | + flags: integration |
| 106 | + fail_ci_if_error: false |
| 107 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments