]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Upload all coverage reports at once after tests.
authorNathan Moinvaziri <nathan@nathanm.com>
Sat, 13 Jan 2024 22:26:39 +0000 (14:26 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 16 Jan 2024 17:46:25 +0000 (18:46 +0100)
.github/workflows/cmake.yml
.github/workflows/pigz.yml

index 11fbe960ad64da4687d360bf71bbcb213e20865c..2b850702c16307cbdd64c9afdeac5004cbf175e0 100644 (file)
@@ -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}}"
index f1147a4e6ecb9683fad8d6a80f23842ba55d1140..ea9af014b9725aa9fbd0facdbf9028d3ca84c19d 100644 (file)
@@ -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}}"