diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2461e1b8e..a74262479 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -174,7 +174,7 @@ jobs: server: ${{ matrix.httpServer }} coreVersion: ${{ matrix.coreVersion }} - - name: Upload the log file + - name: Upload the log file as artifact uses: actions/upload-artifact@v2 with: name: Nextcloud-logs (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}}) @@ -186,22 +186,6 @@ jobs: echo "Exiting with ${{ env.test_result }}" ; exit "${{ env.test_result }}" - - name: Upload the coverage reports to codecov.io - shell: bash - run: >- - bash <(curl -s https://codecov.io/bash) - -F unittests - -f .github/actions/run-tests/volumes/coverage/latest/coverage.unit.xml - -R . - -X gcov - && - bash <(curl -s https://codecov.io/bash) - -F integration - -f .github/actions/run-tests/volumes/coverage/latest/coverage.integration.xml - -R . - -X gcov - if: ${{ steps.run-tests.outputs.silentFail == 'false' }} - - name: Copy coverage-reports into non-link folder shell: bash run: >- @@ -209,14 +193,14 @@ jobs: rsync -a .github/actions/run-tests/volumes/coverage/latest/ /tmp/coverage if: ${{ steps.run-tests.outputs.silentFail == 'false' }} - - name: Upload the code coverage report (unit tests) + - name: Upload the code coverage report (unit tests) as artifacts uses: actions/upload-artifact@v2 with: name: Code coverage (HTML) (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}}) path: "/tmp/coverage" if: ${{ steps.run-tests.outputs.silentFail == 'false' }} - - name: Upload the junit log file artifact + - name: Upload the junit log file artifact as artifact uses: actions/upload-artifact@v2 with: name: Junit test log files (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}}) @@ -224,6 +208,74 @@ jobs: if: always() + upload-codecov: + name: Upload artifacts to codecov.io + needs: + - unit-tests + runs-on: ubuntu-latest + + steps: + - name: Create folder structure + run: mkdir artifacts code unit-coverage integration-coverage + - name: Download artifacts + uses: actions/download-artifact@v2.0.10 + with: + path: artifacts + - name: Checkout of code base + uses: actions/checkout@v2 + with: + path: code + fetch-depth: 2 + + - name: Download the uploader + run: | + curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + + chmod +x codecov + + - name: Copy Coverage reports to separate folders + run: | + cd artifacts + + for i in Code* + do + if [ -f "$i/coverage.unit.xml" ]; then + mkdir -p "../unit-coverage/$i" + cp "$i/coverage.unit.xml" "../unit-coverage/$i/coverage.xml" + fi + if [ -f "$i/coverage.integration.xml" ]; then + mkdir -p "../integration-coverage/$i" + cp "$i/coverage.integration.xml" "../integration-coverage/$i/coverage.xml" + fi + done + - name: Show file structure + run: ls -lR unit-coverage integration-coverage + + - name: Upload unit test codecov reports + run: >- + ./codecov + -F unittests + -s unit-coverage + -R code + -X gcov + -v + - name: Upload integration test codecov reports + run: >- + ./codecov + -F integration + -s integration-coverage + -R code + -X gcov + -v + + + source-package: name: Create source code artifacts needs: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f39ebdf0..a612d64b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ [#807](https://github.com/nextcloud/cookbook/pull/807) @christianlupus - Correct unit testing for dependabot and forked branches [#811](https://github.com/nextcloud/cookbook/pull/811) @christianlupus +- Updated codecov parser to binary version (fix #810) + [#813](https://github.com/nextcloud/cookbook/pull/813) @christianlupus ## 0.9.4 - 2021-09-29