From: Nathan Moinvaziri Date: Sat, 13 Jan 2024 22:26:39 +0000 (-0800) Subject: Upload all coverage reports at once after tests. X-Git-Tag: 2.2.0~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f23a63107e8cf083ab382a6867d371f870105eda;p=thirdparty%2Fzlib-ng.git Upload all coverage reports at once after tests. --- diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 11fbe960..2b850702 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -535,7 +535,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - show-progress: 'false' + show-progress: false - name: Checkout test corpora uses: actions/checkout@v4 @@ -545,7 +545,7 @@ jobs: with: repository: zlib-ng/corpora path: test/data/corpora - show-progress: 'false' + show-progress: false - name: Add repositories (Wine) if: contains(matrix.packages, 'wine32') @@ -662,23 +662,18 @@ jobs: --exclude-unreachable-branches \ --gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" \ --root ${{ matrix.build-src-dir || '.' }} \ - --xml --output coverage.xml + --xml --output ${{ matrix.codecov }}.xml - - name: Upload coverage report - uses: codecov/codecov-action@v3 - if: matrix.codecov && (env.CODECOV_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng') + - name: Upload coverage report artifact + uses: actions/upload-artifact@v4 + if: matrix.codecov with: - token: ${{ secrets.CODECOV_TOKEN || 'e4fdf847-f541-4ab1-9d50-3d27e5913906' }} - flags: ${{ matrix.codecov }} - name: ${{ matrix.name }} - directory: ${{ matrix.build-src-dir || '.' }} - verbose: true - fail_ci_if_error: true - env: - CODECOV_TOKEN: "${{secrets.CODECOV_TOKEN}}" + name: ${{ matrix.name }} (coverage) + path: ${{ matrix.codecov }}.xml + retention-days: 1 - name: Upload build errors - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: ${{ matrix.name }} (cmake) @@ -688,3 +683,35 @@ jobs: **/Testing/Temporary/* coverage.xml retention-days: 30 + + coverage: + name: Upload Coverage Reports + runs-on: ubuntu-latest + needs: cmake + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + show-progress: false + + - name: Download all reports + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + - name: Display all coverage artifacts + run: | + ls -R *.xml + echo "CODECOV_REPORTS=`ls -p *.xml | grep -v / | tr '\n' ','`" >> $GITHUB_ENV + + - name: Upload reports + uses: codecov/codecov-action@v3 + if: (env.CODECOV_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng') + with: + token: ${{ secrets.CODECOV_TOKEN || 'e4fdf847-f541-4ab1-9d50-3d27e5913906' }} + files: ${{ env.CODECOV_REPORTS }} + name: cmake-umbrella + verbose: true + fail_ci_if_error: true + env: + CODECOV_TOKEN: "${{secrets.CODECOV_TOKEN}}" diff --git a/.github/workflows/pigz.yml b/.github/workflows/pigz.yml index f1147a4e..ea9af014 100644 --- a/.github/workflows/pigz.yml +++ b/.github/workflows/pigz.yml @@ -110,19 +110,15 @@ jobs: --exclude-unreachable-branches \ --gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" \ --root . \ - --xml --output coverage.xml + --xml --output ${{ matrix.codecov }}.xml - - name: Upload coverage report - uses: codecov/codecov-action@v3 - if: matrix.codecov && (env.CODECOV_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng') + - name: Upload coverage report artifact + uses: actions/upload-artifact@v4 + if: matrix.codecov with: - token: ${{ secrets.CODECOV_TOKEN || 'e4fdf847-f541-4ab1-9d50-3d27e5913906' }} - flags: ${{ matrix.codecov }} - name: ${{ matrix.name }} - verbose: true - fail_ci_if_error: true - env: - CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} + name: ${{ matrix.name }} (coverage) + path: ${{ matrix.codecov }}.xml + retention-days: 1 - name: Upload build errors uses: actions/upload-artifact@v3 @@ -135,3 +131,35 @@ jobs: **/Testing/Temporary/* coverage.xml retention-days: 30 + + coverage: + name: Upload Coverage Reports + runs-on: ubuntu-latest + needs: pigz + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + show-progress: false + + - name: Download all reports + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + - name: Display all coverage artifacts + run: | + ls -R *.xml + echo "CODECOV_REPORTS=`ls -p *.xml | grep -v / | tr '\n' ','`" >> $GITHUB_ENV + + - name: Upload reports + uses: codecov/codecov-action@v3 + if: (env.CODECOV_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng') + with: + token: ${{ secrets.CODECOV_TOKEN || 'e4fdf847-f541-4ab1-9d50-3d27e5913906' }} + files: ${{ env.CODECOV_REPORTS }} + name: pigz-umbrella + verbose: true + fail_ci_if_error: true + env: + CODECOV_TOKEN: "${{secrets.CODECOV_TOKEN}}"