From 1b8c628a975fd7b9b7824e852d318292e4efa524 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 17:45:02 +0100 Subject: [PATCH 01/30] Switch to codecov --- .github/codecov.yml | 35 ++++++++++++++++++++++++++ .github/workflows/czishrink_dotnet.yml | 34 ++++++++----------------- 2 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..2a6008a --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,35 @@ +# Based on https://docs.codecov.com/docs/common-recipe-list#set-non-blocking-status-checks +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true +# Based on https://docs.codecov.com/docs/flags#recommended-automatic-flag-management +flag_management: + default_rules: + statuses: + - type: project + informational: true + - type: patch + informational: true +# Based on https://docs.codecov.com/docs/components +# Based on https://github.com/codecov/example-components +# Based on https://about.codecov.io/blog/codecov-components-breaking-down-coverage-by-filters/ +# Based on https://about.codecov.io/blog/granular-test-coverage-analysis-using-components-in-codecov/ +component_management: + default_rules: + statuses: + - type: project + informational: true + - type: patch + informational: true + individual_components: + - component_id: "id_czishrink" + name: czishrink + paths: + - "czishrink/" +comment: + layout: "header, diff, flags, components" # show component info in the PR comment \ No newline at end of file diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index 67f43d7..1d36bbd 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -69,12 +69,12 @@ jobs: run: dotnet restore - name: Build - run: dotnet build --no-restore -c Release + run: dotnet build --no-restore -c Debug - name: Test run: > dotnet test - -c Release + -c Debug --no-build --verbosity normal --logger trx @@ -86,6 +86,15 @@ jobs: -p:ExcludeByFile=**/*.axaml%2c**/*.g.cs -p:Exclude='[netczicompress]netczicompress.Views.*' + - name: Upload coverage reports for czishrink to Codecov + if: matrix.config.name == 'ubuntu' + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + directory: ${{ github.workspace }}/TestResults + files: coverage.cobertura.xml + verbose: true + - name: Upload dotnet test results uses: actions/upload-artifact@v3 with: @@ -94,27 +103,6 @@ jobs: # Use always() to also publish test results when there are test failures if: ${{ always() }} - - name: Code Coverage Report - uses: irongut/CodeCoverageSummary@v1.3.0 - if: matrix.config.name == 'ubuntu' - with: - filename: TestResults/coverage.cobertura.xml - badge: true - fail_below_min: false - format: markdown - hide_branch_rate: false - hide_complexity: false - indicators: true - output: both - thresholds: '60 80' - - - name: Add Coverage PR Comment - uses: marocchino/sticky-pull-request-comment@v2 - if: github.event_name == 'pull_request' && matrix.config.name == 'ubuntu' - with: - recreate: true - path: code-coverage-results.md - - name: Publish if: github.event_name == 'push' run: > From d9f5f2ca4d1009c03adcd18b4eafc126ddb6a619 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 18:11:19 +0100 Subject: [PATCH 02/30] Add placeholder for czicompress later on --- .github/codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index 2a6008a..1d22f81 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,3 +1,4 @@ +--- # Based on https://docs.codecov.com/docs/common-recipe-list#set-non-blocking-status-checks coverage: status: @@ -27,6 +28,11 @@ component_management: - type: patch informational: true individual_components: + # Placeholder once coverage measured for czicompress + # - component_id: "id_czicompress" + # name: czicompress + # paths: + # - "czicompress/" - component_id: "id_czishrink" name: czishrink paths: From bf60a1193c1fe5f9a875edc638c6fe39c9f805f6 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 19:33:02 +0100 Subject: [PATCH 03/30] Add coverage info for czicompress --- .github/codecov.yml | 9 ++++----- .github/workflows/czicompress_cmake.yml | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 1d22f81..5e48d22 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -28,11 +28,10 @@ component_management: - type: patch informational: true individual_components: - # Placeholder once coverage measured for czicompress - # - component_id: "id_czicompress" - # name: czicompress - # paths: - # - "czicompress/" + - component_id: "id_czicompress" + name: czicompress + paths: + - "czicompress/" - component_id: "id_czishrink" name: czishrink paths: diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 7447d00..8af0915 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -83,6 +83,28 @@ jobs: # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C ${{env.BUILD_TYPE}} + # Coverage collection based on https://about.codecov.io/blog/how-to-set-up-codecov-with-c-plus-plus-and-github-actions/ + - name: Prepare Coverage + if: matrix.config.OS == 'windows-latest' + run: | + choco install OpenCppCoverage -y + echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH + + - name: Get Coverage + if: matrix.OS == 'windows-latest' + working-directory: ${{github.workspace}}/czicompress/build/czicompress/czicompress_tests/${{env.BUILD_TYPE}} + shell: cmd + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --sources=czicompress --module=czicompress --optimized_build -- czicompress_tests.exe + + - name: Upload Coverage + uses: codecov/codecov-action@v3 + if: matrix.config.OS == 'windows-latest' + with: + files: coverage.xml + fail_ci_if_error: true + directory: ${{ github.workspace }}/TestResults + verbose: true + - name: Prepare licenses shell: bash run: | From 0e72c8fde940a703cd5f5f2a1550a882adc5e48f Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 19:42:45 +0100 Subject: [PATCH 04/30] Fix typo --- .github/workflows/czicompress_cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 8af0915..036e42b 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -85,20 +85,20 @@ jobs: # Coverage collection based on https://about.codecov.io/blog/how-to-set-up-codecov-with-c-plus-plus-and-github-actions/ - name: Prepare Coverage - if: matrix.config.OS == 'windows-latest' + if: matrix.config.os == 'windows-latest' run: | choco install OpenCppCoverage -y echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH - name: Get Coverage - if: matrix.OS == 'windows-latest' + if: matrix.config.os == 'windows-latest' working-directory: ${{github.workspace}}/czicompress/build/czicompress/czicompress_tests/${{env.BUILD_TYPE}} shell: cmd run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --sources=czicompress --module=czicompress --optimized_build -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 - if: matrix.config.OS == 'windows-latest' + if: matrix.config.os == 'windows-latest' with: files: coverage.xml fail_ci_if_error: true From a0b998a1847f71275cf717dc5e7f34585b398b0a Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 21:25:53 +0100 Subject: [PATCH 05/30] Fix paths --- .github/workflows/czicompress_cmake.yml | 4 ++-- opencppcoverage.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 opencppcoverage.txt diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 036e42b..efd965b 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -92,9 +92,9 @@ jobs: - name: Get Coverage if: matrix.config.os == 'windows-latest' - working-directory: ${{github.workspace}}/czicompress/build/czicompress/czicompress_tests/${{env.BUILD_TYPE}} + working-directory: ${{github.workspace}}/czicompress/build/tests/${{env.BUILD_TYPE}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --sources=czicompress --module=czicompress --optimized_build -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --optimized_build -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 diff --git a/opencppcoverage.txt b/opencppcoverage.txt new file mode 100644 index 0000000..e47c285 --- /dev/null +++ b/opencppcoverage.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2017-2022 Carl Zeiss Microscopy GmbH +# +# SPDX-License-Identifier: MIT +sources=czicompress +modules=czicompress \ No newline at end of file From 9a7c8590badc1812b2b660313753135f05d37d39 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 21:52:36 +0100 Subject: [PATCH 06/30] Specify opencppcoverage config file --- .github/workflows/czicompress_cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index efd965b..f5271a7 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -94,7 +94,7 @@ jobs: if: matrix.config.os == 'windows-latest' working-directory: ${{github.workspace}}/czicompress/build/tests/${{env.BUILD_TYPE}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --optimized_build -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" --optimized_build -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 From d20b81623c294fd80bab812d1520e45c200a0571 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 23:41:19 +0100 Subject: [PATCH 07/30] Move modules --- .github/workflows/czicompress_cmake.yml | 2 +- opencppcoverage.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index f5271a7..7b3703e 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -94,7 +94,7 @@ jobs: if: matrix.config.os == 'windows-latest' working-directory: ${{github.workspace}}/czicompress/build/tests/${{env.BUILD_TYPE}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" --optimized_build -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" --modules ${{github.workspace}}\czicompress\build\tests\${{env.BUILD_TYPE}} --optimized_build -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 diff --git a/opencppcoverage.txt b/opencppcoverage.txt index e47c285..860b55f 100644 --- a/opencppcoverage.txt +++ b/opencppcoverage.txt @@ -2,4 +2,3 @@ # # SPDX-License-Identifier: MIT sources=czicompress -modules=czicompress \ No newline at end of file From 4127c6812c82190b559aac807fbab10b1fc237a8 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 00:21:35 +0100 Subject: [PATCH 08/30] Make coverage use debug build --- .github/workflows/czicompress_cmake.yml | 41 +++++++++++++++---------- opencppcoverage.txt | 1 + 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 7b3703e..e41a4da 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -11,11 +11,6 @@ on: permissions: contents: read -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - # or setup build type in the matrix - BUILD_TYPE: Release - jobs: build-tests: defaults: @@ -27,6 +22,7 @@ jobs: strategy: fail-fast: false matrix: + build: [Release, Debug] config: # Create matrix with combinations of compiler and options. # Notes: # - the property 'package' is controlling whether the build-time-dependencies (i.e. eigen3, cli11, catch2) are pulled in via the @@ -61,7 +57,18 @@ jobs: path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux', } - + exclude: + - build: Debug + config: + - { + name: ubuntu-release-package-on, + os: ubuntu-20.04, # we want to use an older version in order to increase likelihood that binaries work on other distros + platform: x64-linux, + package: OFF, + path-cache: '/usr/local/share/vcpkg/installed', + path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', + os-id: 'linux', + } steps: - name: Checkout the source codes. @@ -72,7 +79,7 @@ jobs: path-cache: ${{matrix.config.path-cache}} path-toolchain: ${{matrix.config.path-toolchain}} os-id: ${{matrix.config.os-id}} - build-type: ${{env.BUILD_TYPE}} + build-type: ${{matrix.build}} package: ${{matrix.config.package}} platform: ${{matrix.config.platform}} src-dir: '${{github.workspace}}/czicompress' @@ -81,24 +88,24 @@ jobs: working-directory: ${{github.workspace}}/czicompress/build # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} + run: ctest -C ${{matrix.build}} # Coverage collection based on https://about.codecov.io/blog/how-to-set-up-codecov-with-c-plus-plus-and-github-actions/ - name: Prepare Coverage - if: matrix.config.os == 'windows-latest' + if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} run: | choco install OpenCppCoverage -y echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH - name: Get Coverage - if: matrix.config.os == 'windows-latest' - working-directory: ${{github.workspace}}/czicompress/build/tests/${{env.BUILD_TYPE}} + if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} + working-directory: ${{github.workspace}}/czicompress/build/tests/${{matrix.build}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" --modules ${{github.workspace}}\czicompress\build\tests\${{env.BUILD_TYPE}} --optimized_build -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 - if: matrix.config.os == 'windows-latest' + if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} with: files: coverage.xml fail_ci_if_error: true @@ -106,6 +113,7 @@ jobs: verbose: true - name: Prepare licenses + if: matrix.build == 'Release' shell: bash run: | set -e @@ -115,19 +123,20 @@ jobs: # gather the binaries - name: Prepare Linux binaries - if: matrix.config.os == 'ubuntu-20.04' + if: ${{ (matrix.config.os == 'ubuntu-20.04') && (matrix.build == 'Release') }} shell: bash run: | cp ./build/app/czicompress ./build/capi/libczicompressc.so ./czicompress-${{matrix.config.name}}/ - name: Prepare Windows binaries - if: matrix.config.os == 'windows-latest' + if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Release') }} shell: bash run: | - cp ./build/app/${{env.BUILD_TYPE}}/*.exe ./build/capi/${{env.BUILD_TYPE}}/libczicompressc.dll ./czicompress-${{matrix.config.name}}/ + cp ./build/app/${{matrix.build}}/*.exe ./build/capi/${{matrix.build}}/libczicompressc.dll ./czicompress-${{matrix.config.name}}/ # upload the build-results to artifacts-store - name: Upload artifacts + if: matrix.build == 'Release' uses: actions/upload-artifact@v3 with: name: czicompress-${{matrix.config.name}} diff --git a/opencppcoverage.txt b/opencppcoverage.txt index 860b55f..bd46f50 100644 --- a/opencppcoverage.txt +++ b/opencppcoverage.txt @@ -2,3 +2,4 @@ # # SPDX-License-Identifier: MIT sources=czicompress +modules=czicompress From 74420310f82eec4911e1790ad437b9caf804bc60 Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Fri, 10 Nov 2023 08:32:31 +0100 Subject: [PATCH 09/30] Update codecov.yml (for megalinter) --- .github/codecov.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 5e48d22..48a89f3 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -37,4 +37,5 @@ component_management: paths: - "czishrink/" comment: - layout: "header, diff, flags, components" # show component info in the PR comment \ No newline at end of file + layout: "header, diff, flags, components" # show component info in the PR comment + From d19453d4057c028e6257c675ab4a783e68cf5914 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 11:47:22 +0100 Subject: [PATCH 10/30] Fix matrix issue --- .github/workflows/czicompress_cmake.yml | 58 ++++++++++--------------- czicompress/README.md | 4 +- czishrink/upgrade-libczicompressc.ps1 | 4 +- opencppcoverage.txt | 1 + 4 files changed, 28 insertions(+), 39 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index e41a4da..8e01d56 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -16,7 +16,10 @@ jobs: defaults: run: working-directory: ${{github.workspace}}/czicompress - name: ${{matrix.config.name}} + # https://stackoverflow.com/questions/69636799/how-do-i-pass-the-job-name-into-a-github-actions-input + env: + name: ${{matrix.config.name}}-${{matrix.build}} + name: ${{matrix.config.name}}-${{matrix.build}} runs-on: ${{matrix.config.os}} strategy: @@ -25,22 +28,9 @@ jobs: build: [Release, Debug] config: # Create matrix with combinations of compiler and options. # Notes: - # - the property 'package' is controlling whether the build-time-dependencies (i.e. eigen3, cli11, catch2) are pulled in via the - # system's package manager or via CMake at build-time. - # - { - # name: windows-64-release-msvc-package-off, - # os: windows-latest, - # platform: x64-windows, - # package: OFF - # } - # - { - # name: ubuntu-release-package-off, - # os: ubuntu-latest, - # platform: x64-linux, - # package: OFF - # } + # The property 'package' is controlling whether the build-time-dependencies (i.e. eigen3, cli11, catch2) are pulled in via the system's package manager or via CMake at build-time. - { - name: windows-64-release-msvc-package-on, + name: windows-64-msvc-package-on, os: windows-latest, platform: x64-windows-static, package: ON, @@ -49,7 +39,7 @@ jobs: os-id: 'windows', } - { - name: ubuntu-release-package-on, + name: ubuntu-package-off, os: ubuntu-20.04, # we want to use an older version in order to increase likelihood that binaries work on other distros platform: x64-linux, package: OFF, @@ -58,17 +48,15 @@ jobs: os-id: 'linux', } exclude: - - build: Debug - config: - - { - name: ubuntu-release-package-on, - os: ubuntu-20.04, # we want to use an older version in order to increase likelihood that binaries work on other distros - platform: x64-linux, - package: OFF, - path-cache: '/usr/local/share/vcpkg/installed', - path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', - os-id: 'linux', - } + # From https://github.com/actions/runner/issues/1512 + - build: debug + {config: { name: ubuntu-package-off, + os: ubuntu-20.04, + platform: x64-linux, + package: OFF, + path-cache: '/usr/local/share/vcpkg/installed', + path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', + os-id: 'linux',}} steps: - name: Checkout the source codes. @@ -117,27 +105,27 @@ jobs: shell: bash run: | set -e - mkdir ./czicompress-${{matrix.config.name}} - cp -R ./THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt ./czicompress-${{matrix.config.name}}/ - cp -R ./build/app/THIRD_PARTY_LICENSES.txt ./czicompress-${{matrix.config.name}}/ + mkdir ./czicompress-${{env.name}} + cp -R ./THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt ./czicompress-${{env.name}}/ + cp -R ./build/app/THIRD_PARTY_LICENSES.txt ./czicompress-${{env.name}}/ # gather the binaries - name: Prepare Linux binaries if: ${{ (matrix.config.os == 'ubuntu-20.04') && (matrix.build == 'Release') }} shell: bash run: | - cp ./build/app/czicompress ./build/capi/libczicompressc.so ./czicompress-${{matrix.config.name}}/ + cp ./build/app/czicompress ./build/capi/libczicompressc.so ./czicompress-${{env.name}}/ - name: Prepare Windows binaries if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Release') }} shell: bash run: | - cp ./build/app/${{matrix.build}}/*.exe ./build/capi/${{matrix.build}}/libczicompressc.dll ./czicompress-${{matrix.config.name}}/ + cp ./build/app/${{matrix.build}}/*.exe ./build/capi/${{matrix.build}}/libczicompressc.dll ./czicompress-${{env.name}}/ # upload the build-results to artifacts-store - name: Upload artifacts if: matrix.build == 'Release' uses: actions/upload-artifact@v3 with: - name: czicompress-${{matrix.config.name}} - path: czicompress/czicompress-${{matrix.config.name}}/ + name: czicompress-${{env.name}} + path: czicompress/czicompress-${{env.name}}/ diff --git a/czicompress/README.md b/czicompress/README.md index 46df990..bf4a58f 100644 --- a/czicompress/README.md +++ b/czicompress/README.md @@ -38,8 +38,8 @@ The tool is based on [libczi](https://github.com/ZEISS/libczi.git). ## Download We have not yet published any Releases. Meanwhile, you can download binaries from the artifacts of the latest [Build workflow run](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml?query=branch%3Amain). Click on the topmost successful run and download the binaries for your platform: -* czicompress-windows-64-release-msvc-package-off for Windows -* czicompress-ubuntu-release-llvm-package-off for Linux +* czicompress-windows-64-msvc-package-on-Release for Windows +* czicompress-ubuntu-llvm-package-off-Release for Linux Clicking on these artifacts will download a ZIP file with the executable. The executable is a stand-alone binary. You can put it anywhere you like. diff --git a/czishrink/upgrade-libczicompressc.ps1 b/czishrink/upgrade-libczicompressc.ps1 index 09da8d8..8caf473 100644 --- a/czishrink/upgrade-libczicompressc.ps1 +++ b/czishrink/upgrade-libczicompressc.ps1 @@ -137,8 +137,8 @@ if ($DownloadWindows -or $DownloadLinux) Write-Output "INFO: Downloading artifacts from $($LatestRunOfCMakeBuild.artifacts_url)" $ServerResponse = Invoke-WebRequest -Uri $LatestRunOfCMakeBuild.artifacts_url -Headers $GithubApiHeaders | ConvertFrom-Json - $LinuxArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-ubuntu-release-package-on" - $WindowsArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-windows-64-release-msvc-package-on" + $LinuxArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-ubuntu-package-off-Release" + $WindowsArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-windows-64-msvc-package-on-Release" if ($ServerResponse.total_count -eq 0) { throw "No artifacts found." diff --git a/opencppcoverage.txt b/opencppcoverage.txt index bd46f50..d3ef98d 100644 --- a/opencppcoverage.txt +++ b/opencppcoverage.txt @@ -3,3 +3,4 @@ # SPDX-License-Identifier: MIT sources=czicompress modules=czicompress +excluded_sources=czicompress\tests\ \ No newline at end of file From b80f80d23f8a9981a2820280e6bb7e02c7d5fb62 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 12:10:47 +0100 Subject: [PATCH 11/30] Update czicompress_cmake.yml --- .github/workflows/czicompress_cmake.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 8e01d56..71deb29 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -50,13 +50,7 @@ jobs: exclude: # From https://github.com/actions/runner/issues/1512 - build: debug - {config: { name: ubuntu-package-off, - os: ubuntu-20.04, - platform: x64-linux, - package: OFF, - path-cache: '/usr/local/share/vcpkg/installed', - path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', - os-id: 'linux',}} + {config: { name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux',}} steps: - name: Checkout the source codes. From afbd2a62c926be5afb32f8426e8836e3b9083613 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 12:12:23 +0100 Subject: [PATCH 12/30] Update czicompress_cmake.yml --- .github/workflows/czicompress_cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 71deb29..8d15565 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -50,7 +50,7 @@ jobs: exclude: # From https://github.com/actions/runner/issues/1512 - build: debug - {config: { name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux',}} + config: { name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux',} steps: - name: Checkout the source codes. From 192c3dd256a5ee00c8f6ae1217e450137491ad46 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 14:35:29 +0100 Subject: [PATCH 13/30] Fix MegaLinter and Coverage setup --- .github/codecov.yml | 1 - .github/workflows/czicompress_cmake.yml | 9 +++++---- .github/workflows/czishrink_dotnet.yml | 23 +++++++++++++---------- czishrink/README.md | 3 +-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 48a89f3..6cf675b 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -38,4 +38,3 @@ component_management: - "czishrink/" comment: layout: "header, diff, flags, components" # show component info in the PR comment - diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 8d15565..77d25cf 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -49,8 +49,8 @@ jobs: } exclude: # From https://github.com/actions/runner/issues/1512 - - build: debug - config: { name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux',} + - build: Debug + config: {name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux'} steps: - name: Checkout the source codes. @@ -75,9 +75,10 @@ jobs: # Coverage collection based on https://about.codecov.io/blog/how-to-set-up-codecov-with-c-plus-plus-and-github-actions/ - name: Prepare Coverage if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} + shell: pwsh run: | - choco install OpenCppCoverage -y - echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH + choco install OpenCppCoverage -y + echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH - name: Get Coverage if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index 1d36bbd..2e57548 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -19,23 +19,26 @@ jobs: defaults: run: working-directory: czishrink - name: ${{matrix.config.name}} + name: ${{matrix.config.os}}-${{matrix.build}} runs-on: ${{matrix.config.os}} strategy: fail-fast: false matrix: + build: [Release, Debug] config: - { - name: windows, os: windows-latest, osfamily: win, } - { - name: ubuntu, os: ubuntu-latest, osfamily: linux, } + exclude: + # From https://github.com/actions/runner/issues/1512 + - build: Debug + config: {os: windows-latest, osfamily: win} steps: - uses: actions/checkout@v3 @@ -69,12 +72,12 @@ jobs: run: dotnet restore - name: Build - run: dotnet build --no-restore -c Debug + run: dotnet build --no-restore -c ${{ matrix.build }} - name: Test run: > dotnet test - -c Debug + -c ${{ matrix.build }} --no-build --verbosity normal --logger trx @@ -87,7 +90,7 @@ jobs: -p:Exclude='[netczicompress]netczicompress.Views.*' - name: Upload coverage reports for czishrink to Codecov - if: matrix.config.name == 'ubuntu' + if: ${{ (matrix.config.os == 'ubuntu-latest') && (matrix.build == 'Debug') }} uses: codecov/codecov-action@v3 with: fail_ci_if_error: true @@ -98,16 +101,16 @@ jobs: - name: Upload dotnet test results uses: actions/upload-artifact@v3 with: - name: dotnet-results-${{ matrix.config.name }} + name: dotnet-results-${{ matrix.config.os }} path: TestResults # Use always() to also publish test results when there are test failures if: ${{ always() }} - name: Publish - if: github.event_name == 'push' + if: ${{ (github.event_name == 'push') && (matrix.build == Release) }} run: > dotnet publish netczicompress.Desktop/netczicompress.Desktop.csproj - -c Release + -c ${{ matrix.build }} -a x64 --self-contained -p:PublishSingleFile=true @@ -117,7 +120,7 @@ jobs: - name: Upload published binaries uses: actions/upload-artifact@v3 - if: github.event_name == 'push' + if: ${{ (github.event_name == 'push') && (matrix.build == Release) }} with: name: CziShrink_${{ steps.getversion.outputs.version }}_${{ matrix.config.osfamily}}-x64 path: publish diff --git a/czishrink/README.md b/czishrink/README.md index d913df3..848307a 100644 --- a/czishrink/README.md +++ b/czishrink/README.md @@ -4,7 +4,6 @@ An open source and cross-platform GUI for [CziCompress](https://github.com/ZEISS ## Table of contents - [Overview](#overview) - - [Download](#download) - [System Requirements](#system-requirements) - [Theme Support](#theme-support) - [I/O](#io) @@ -18,7 +17,7 @@ An open source and cross-platform GUI for [CziCompress](https://github.com/ZEISS - [FAQ](#faq) - [Known Issues](#known-issues) - [Potential Future Enhancements](#potential-future-enhancements) - - [Feedback](#feedback) + - [Contributing](#contributing) ## Overview From 0cf170aef36c6b54091ac8e78630fd01db523cac Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 14:56:27 +0100 Subject: [PATCH 14/30] Fix quoting issue --- .github/workflows/czishrink_dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index 2e57548..1f02370 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -107,7 +107,7 @@ jobs: if: ${{ always() }} - name: Publish - if: ${{ (github.event_name == 'push') && (matrix.build == Release) }} + if: ${{ (github.event_name == 'push') && (matrix.build == 'Release') }} run: > dotnet publish netczicompress.Desktop/netczicompress.Desktop.csproj -c ${{ matrix.build }} @@ -120,7 +120,7 @@ jobs: - name: Upload published binaries uses: actions/upload-artifact@v3 - if: ${{ (github.event_name == 'push') && (matrix.build == Release) }} + if: ${{ (github.event_name == 'push') && (matrix.build == 'Release') }} with: name: CziShrink_${{ steps.getversion.outputs.version }}_${{ matrix.config.osfamily}}-x64 path: publish From a76a1d7beac27d6d1f120c52c8387db424c8c1c7 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 17:45:02 +0100 Subject: [PATCH 15/30] Switch to codecov --- .github/codecov.yml | 35 ++++++++++++++++++++++++++ .github/workflows/czishrink_dotnet.yml | 34 ++++++++----------------- 2 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 0000000..2a6008a --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,35 @@ +# Based on https://docs.codecov.com/docs/common-recipe-list#set-non-blocking-status-checks +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true +# Based on https://docs.codecov.com/docs/flags#recommended-automatic-flag-management +flag_management: + default_rules: + statuses: + - type: project + informational: true + - type: patch + informational: true +# Based on https://docs.codecov.com/docs/components +# Based on https://github.com/codecov/example-components +# Based on https://about.codecov.io/blog/codecov-components-breaking-down-coverage-by-filters/ +# Based on https://about.codecov.io/blog/granular-test-coverage-analysis-using-components-in-codecov/ +component_management: + default_rules: + statuses: + - type: project + informational: true + - type: patch + informational: true + individual_components: + - component_id: "id_czishrink" + name: czishrink + paths: + - "czishrink/" +comment: + layout: "header, diff, flags, components" # show component info in the PR comment \ No newline at end of file diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index 7101722..86596ac 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -69,12 +69,12 @@ jobs: run: dotnet restore - name: Build - run: dotnet build --no-restore -c Release + run: dotnet build --no-restore -c Debug - name: Test run: > dotnet test - -c Release + -c Debug --no-build --verbosity normal --logger trx @@ -86,6 +86,15 @@ jobs: -p:ExcludeByFile=**/*.axaml%2c**/*.g.cs -p:Exclude='[netczicompress]netczicompress.Views.*' + - name: Upload coverage reports for czishrink to Codecov + if: matrix.config.name == 'ubuntu' + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + directory: ${{ github.workspace }}/TestResults + files: coverage.cobertura.xml + verbose: true + - name: Upload dotnet test results uses: actions/upload-artifact@v3 with: @@ -94,27 +103,6 @@ jobs: # Use always() to also publish test results when there are test failures if: ${{ always() }} - - name: Code Coverage Report - uses: irongut/CodeCoverageSummary@v1.3.0 - if: matrix.config.name == 'ubuntu' - with: - filename: TestResults/coverage.cobertura.xml - badge: true - fail_below_min: false - format: markdown - hide_branch_rate: false - hide_complexity: false - indicators: true - output: both - thresholds: '60 80' - - - name: Add Coverage PR Comment - uses: marocchino/sticky-pull-request-comment@v2 - if: github.event_name == 'pull_request' && matrix.config.name == 'ubuntu' - with: - recreate: true - path: code-coverage-results.md - - name: Publish if: github.event_name == 'push' run: > From 4e90ae00df9eaa1bac46561c85bd2a2fd26e581e Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 18:11:19 +0100 Subject: [PATCH 16/30] Add placeholder for czicompress later on --- .github/codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index 2a6008a..1d22f81 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,3 +1,4 @@ +--- # Based on https://docs.codecov.com/docs/common-recipe-list#set-non-blocking-status-checks coverage: status: @@ -27,6 +28,11 @@ component_management: - type: patch informational: true individual_components: + # Placeholder once coverage measured for czicompress + # - component_id: "id_czicompress" + # name: czicompress + # paths: + # - "czicompress/" - component_id: "id_czishrink" name: czishrink paths: From cf54e448735d013fd8ed6c8c371812be0bd648cc Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 19:33:02 +0100 Subject: [PATCH 17/30] Add coverage info for czicompress --- .github/codecov.yml | 9 ++++----- .github/workflows/czicompress_cmake.yml | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 1d22f81..5e48d22 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -28,11 +28,10 @@ component_management: - type: patch informational: true individual_components: - # Placeholder once coverage measured for czicompress - # - component_id: "id_czicompress" - # name: czicompress - # paths: - # - "czicompress/" + - component_id: "id_czicompress" + name: czicompress + paths: + - "czicompress/" - component_id: "id_czishrink" name: czishrink paths: diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 7447d00..8af0915 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -83,6 +83,28 @@ jobs: # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C ${{env.BUILD_TYPE}} + # Coverage collection based on https://about.codecov.io/blog/how-to-set-up-codecov-with-c-plus-plus-and-github-actions/ + - name: Prepare Coverage + if: matrix.config.OS == 'windows-latest' + run: | + choco install OpenCppCoverage -y + echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH + + - name: Get Coverage + if: matrix.OS == 'windows-latest' + working-directory: ${{github.workspace}}/czicompress/build/czicompress/czicompress_tests/${{env.BUILD_TYPE}} + shell: cmd + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --sources=czicompress --module=czicompress --optimized_build -- czicompress_tests.exe + + - name: Upload Coverage + uses: codecov/codecov-action@v3 + if: matrix.config.OS == 'windows-latest' + with: + files: coverage.xml + fail_ci_if_error: true + directory: ${{ github.workspace }}/TestResults + verbose: true + - name: Prepare licenses shell: bash run: | From 6f1e046d12fc4c311bfd7710f6b2bba341a410f1 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 19:42:45 +0100 Subject: [PATCH 18/30] Fix typo --- .github/workflows/czicompress_cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 8af0915..036e42b 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -85,20 +85,20 @@ jobs: # Coverage collection based on https://about.codecov.io/blog/how-to-set-up-codecov-with-c-plus-plus-and-github-actions/ - name: Prepare Coverage - if: matrix.config.OS == 'windows-latest' + if: matrix.config.os == 'windows-latest' run: | choco install OpenCppCoverage -y echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH - name: Get Coverage - if: matrix.OS == 'windows-latest' + if: matrix.config.os == 'windows-latest' working-directory: ${{github.workspace}}/czicompress/build/czicompress/czicompress_tests/${{env.BUILD_TYPE}} shell: cmd run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --sources=czicompress --module=czicompress --optimized_build -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 - if: matrix.config.OS == 'windows-latest' + if: matrix.config.os == 'windows-latest' with: files: coverage.xml fail_ci_if_error: true From a56a734cfbc5e404d81a8f745e24d0dff55d8374 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 21:25:53 +0100 Subject: [PATCH 19/30] Fix paths --- .github/workflows/czicompress_cmake.yml | 4 ++-- opencppcoverage.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 opencppcoverage.txt diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 036e42b..efd965b 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -92,9 +92,9 @@ jobs: - name: Get Coverage if: matrix.config.os == 'windows-latest' - working-directory: ${{github.workspace}}/czicompress/build/czicompress/czicompress_tests/${{env.BUILD_TYPE}} + working-directory: ${{github.workspace}}/czicompress/build/tests/${{env.BUILD_TYPE}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --sources=czicompress --module=czicompress --optimized_build -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --optimized_build -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 diff --git a/opencppcoverage.txt b/opencppcoverage.txt new file mode 100644 index 0000000..e47c285 --- /dev/null +++ b/opencppcoverage.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2017-2022 Carl Zeiss Microscopy GmbH +# +# SPDX-License-Identifier: MIT +sources=czicompress +modules=czicompress \ No newline at end of file From 7fa839ff192704fb406e615d63d05a4848027916 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 21:52:36 +0100 Subject: [PATCH 20/30] Specify opencppcoverage config file --- .github/workflows/czicompress_cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index efd965b..f5271a7 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -94,7 +94,7 @@ jobs: if: matrix.config.os == 'windows-latest' working-directory: ${{github.workspace}}/czicompress/build/tests/${{env.BUILD_TYPE}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --optimized_build -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" --optimized_build -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 From 34175eb836f746f75739efc0b07c6c6ee661285d Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Thu, 9 Nov 2023 23:41:19 +0100 Subject: [PATCH 21/30] Move modules --- .github/workflows/czicompress_cmake.yml | 2 +- opencppcoverage.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index f5271a7..7b3703e 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -94,7 +94,7 @@ jobs: if: matrix.config.os == 'windows-latest' working-directory: ${{github.workspace}}/czicompress/build/tests/${{env.BUILD_TYPE}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" --optimized_build -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" --modules ${{github.workspace}}\czicompress\build\tests\${{env.BUILD_TYPE}} --optimized_build -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 diff --git a/opencppcoverage.txt b/opencppcoverage.txt index e47c285..860b55f 100644 --- a/opencppcoverage.txt +++ b/opencppcoverage.txt @@ -2,4 +2,3 @@ # # SPDX-License-Identifier: MIT sources=czicompress -modules=czicompress \ No newline at end of file From 1b55d6189b795898a898450d359d2db4748f7972 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 00:21:35 +0100 Subject: [PATCH 22/30] Make coverage use debug build --- .github/workflows/czicompress_cmake.yml | 41 +++++++++++++++---------- opencppcoverage.txt | 1 + 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 7b3703e..e41a4da 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -11,11 +11,6 @@ on: permissions: contents: read -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - # or setup build type in the matrix - BUILD_TYPE: Release - jobs: build-tests: defaults: @@ -27,6 +22,7 @@ jobs: strategy: fail-fast: false matrix: + build: [Release, Debug] config: # Create matrix with combinations of compiler and options. # Notes: # - the property 'package' is controlling whether the build-time-dependencies (i.e. eigen3, cli11, catch2) are pulled in via the @@ -61,7 +57,18 @@ jobs: path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux', } - + exclude: + - build: Debug + config: + - { + name: ubuntu-release-package-on, + os: ubuntu-20.04, # we want to use an older version in order to increase likelihood that binaries work on other distros + platform: x64-linux, + package: OFF, + path-cache: '/usr/local/share/vcpkg/installed', + path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', + os-id: 'linux', + } steps: - name: Checkout the source codes. @@ -72,7 +79,7 @@ jobs: path-cache: ${{matrix.config.path-cache}} path-toolchain: ${{matrix.config.path-toolchain}} os-id: ${{matrix.config.os-id}} - build-type: ${{env.BUILD_TYPE}} + build-type: ${{matrix.build}} package: ${{matrix.config.package}} platform: ${{matrix.config.platform}} src-dir: '${{github.workspace}}/czicompress' @@ -81,24 +88,24 @@ jobs: working-directory: ${{github.workspace}}/czicompress/build # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} + run: ctest -C ${{matrix.build}} # Coverage collection based on https://about.codecov.io/blog/how-to-set-up-codecov-with-c-plus-plus-and-github-actions/ - name: Prepare Coverage - if: matrix.config.os == 'windows-latest' + if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} run: | choco install OpenCppCoverage -y echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH - name: Get Coverage - if: matrix.config.os == 'windows-latest' - working-directory: ${{github.workspace}}/czicompress/build/tests/${{env.BUILD_TYPE}} + if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} + working-directory: ${{github.workspace}}/czicompress/build/tests/${{matrix.build}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" --modules ${{github.workspace}}\czicompress\build\tests\${{env.BUILD_TYPE}} --optimized_build -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 - if: matrix.config.os == 'windows-latest' + if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} with: files: coverage.xml fail_ci_if_error: true @@ -106,6 +113,7 @@ jobs: verbose: true - name: Prepare licenses + if: matrix.build == 'Release' shell: bash run: | set -e @@ -115,19 +123,20 @@ jobs: # gather the binaries - name: Prepare Linux binaries - if: matrix.config.os == 'ubuntu-20.04' + if: ${{ (matrix.config.os == 'ubuntu-20.04') && (matrix.build == 'Release') }} shell: bash run: | cp ./build/app/czicompress ./build/capi/libczicompressc.so ./czicompress-${{matrix.config.name}}/ - name: Prepare Windows binaries - if: matrix.config.os == 'windows-latest' + if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Release') }} shell: bash run: | - cp ./build/app/${{env.BUILD_TYPE}}/*.exe ./build/capi/${{env.BUILD_TYPE}}/libczicompressc.dll ./czicompress-${{matrix.config.name}}/ + cp ./build/app/${{matrix.build}}/*.exe ./build/capi/${{matrix.build}}/libczicompressc.dll ./czicompress-${{matrix.config.name}}/ # upload the build-results to artifacts-store - name: Upload artifacts + if: matrix.build == 'Release' uses: actions/upload-artifact@v3 with: name: czicompress-${{matrix.config.name}} diff --git a/opencppcoverage.txt b/opencppcoverage.txt index 860b55f..bd46f50 100644 --- a/opencppcoverage.txt +++ b/opencppcoverage.txt @@ -2,3 +2,4 @@ # # SPDX-License-Identifier: MIT sources=czicompress +modules=czicompress From d3ec84c198120879c52058d6a39844f595362951 Mon Sep 17 00:00:00 2001 From: m-ringler <42344272+m-ringler@users.noreply.github.com> Date: Fri, 10 Nov 2023 08:32:31 +0100 Subject: [PATCH 23/30] Update codecov.yml (for megalinter) --- .github/codecov.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 5e48d22..48a89f3 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -37,4 +37,5 @@ component_management: paths: - "czishrink/" comment: - layout: "header, diff, flags, components" # show component info in the PR comment \ No newline at end of file + layout: "header, diff, flags, components" # show component info in the PR comment + From 7c75ae4e0ed5608763a85389f1a88440b42f99d6 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 11:47:22 +0100 Subject: [PATCH 24/30] Fix matrix issue --- .github/workflows/czicompress_cmake.yml | 58 ++++++++++--------------- czicompress/README.md | 4 +- czishrink/upgrade-libczicompressc.ps1 | 4 +- opencppcoverage.txt | 1 + 4 files changed, 28 insertions(+), 39 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index e41a4da..8e01d56 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -16,7 +16,10 @@ jobs: defaults: run: working-directory: ${{github.workspace}}/czicompress - name: ${{matrix.config.name}} + # https://stackoverflow.com/questions/69636799/how-do-i-pass-the-job-name-into-a-github-actions-input + env: + name: ${{matrix.config.name}}-${{matrix.build}} + name: ${{matrix.config.name}}-${{matrix.build}} runs-on: ${{matrix.config.os}} strategy: @@ -25,22 +28,9 @@ jobs: build: [Release, Debug] config: # Create matrix with combinations of compiler and options. # Notes: - # - the property 'package' is controlling whether the build-time-dependencies (i.e. eigen3, cli11, catch2) are pulled in via the - # system's package manager or via CMake at build-time. - # - { - # name: windows-64-release-msvc-package-off, - # os: windows-latest, - # platform: x64-windows, - # package: OFF - # } - # - { - # name: ubuntu-release-package-off, - # os: ubuntu-latest, - # platform: x64-linux, - # package: OFF - # } + # The property 'package' is controlling whether the build-time-dependencies (i.e. eigen3, cli11, catch2) are pulled in via the system's package manager or via CMake at build-time. - { - name: windows-64-release-msvc-package-on, + name: windows-64-msvc-package-on, os: windows-latest, platform: x64-windows-static, package: ON, @@ -49,7 +39,7 @@ jobs: os-id: 'windows', } - { - name: ubuntu-release-package-on, + name: ubuntu-package-off, os: ubuntu-20.04, # we want to use an older version in order to increase likelihood that binaries work on other distros platform: x64-linux, package: OFF, @@ -58,17 +48,15 @@ jobs: os-id: 'linux', } exclude: - - build: Debug - config: - - { - name: ubuntu-release-package-on, - os: ubuntu-20.04, # we want to use an older version in order to increase likelihood that binaries work on other distros - platform: x64-linux, - package: OFF, - path-cache: '/usr/local/share/vcpkg/installed', - path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', - os-id: 'linux', - } + # From https://github.com/actions/runner/issues/1512 + - build: debug + {config: { name: ubuntu-package-off, + os: ubuntu-20.04, + platform: x64-linux, + package: OFF, + path-cache: '/usr/local/share/vcpkg/installed', + path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', + os-id: 'linux',}} steps: - name: Checkout the source codes. @@ -117,27 +105,27 @@ jobs: shell: bash run: | set -e - mkdir ./czicompress-${{matrix.config.name}} - cp -R ./THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt ./czicompress-${{matrix.config.name}}/ - cp -R ./build/app/THIRD_PARTY_LICENSES.txt ./czicompress-${{matrix.config.name}}/ + mkdir ./czicompress-${{env.name}} + cp -R ./THIRD_PARTY_LICENSES_ARTIFACT_DISTRIBUTION.txt ./czicompress-${{env.name}}/ + cp -R ./build/app/THIRD_PARTY_LICENSES.txt ./czicompress-${{env.name}}/ # gather the binaries - name: Prepare Linux binaries if: ${{ (matrix.config.os == 'ubuntu-20.04') && (matrix.build == 'Release') }} shell: bash run: | - cp ./build/app/czicompress ./build/capi/libczicompressc.so ./czicompress-${{matrix.config.name}}/ + cp ./build/app/czicompress ./build/capi/libczicompressc.so ./czicompress-${{env.name}}/ - name: Prepare Windows binaries if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Release') }} shell: bash run: | - cp ./build/app/${{matrix.build}}/*.exe ./build/capi/${{matrix.build}}/libczicompressc.dll ./czicompress-${{matrix.config.name}}/ + cp ./build/app/${{matrix.build}}/*.exe ./build/capi/${{matrix.build}}/libczicompressc.dll ./czicompress-${{env.name}}/ # upload the build-results to artifacts-store - name: Upload artifacts if: matrix.build == 'Release' uses: actions/upload-artifact@v3 with: - name: czicompress-${{matrix.config.name}} - path: czicompress/czicompress-${{matrix.config.name}}/ + name: czicompress-${{env.name}} + path: czicompress/czicompress-${{env.name}}/ diff --git a/czicompress/README.md b/czicompress/README.md index 46df990..bf4a58f 100644 --- a/czicompress/README.md +++ b/czicompress/README.md @@ -38,8 +38,8 @@ The tool is based on [libczi](https://github.com/ZEISS/libczi.git). ## Download We have not yet published any Releases. Meanwhile, you can download binaries from the artifacts of the latest [Build workflow run](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml?query=branch%3Amain). Click on the topmost successful run and download the binaries for your platform: -* czicompress-windows-64-release-msvc-package-off for Windows -* czicompress-ubuntu-release-llvm-package-off for Linux +* czicompress-windows-64-msvc-package-on-Release for Windows +* czicompress-ubuntu-llvm-package-off-Release for Linux Clicking on these artifacts will download a ZIP file with the executable. The executable is a stand-alone binary. You can put it anywhere you like. diff --git a/czishrink/upgrade-libczicompressc.ps1 b/czishrink/upgrade-libczicompressc.ps1 index fa0cf4e..dd11fc1 100644 --- a/czishrink/upgrade-libczicompressc.ps1 +++ b/czishrink/upgrade-libczicompressc.ps1 @@ -137,8 +137,8 @@ if ($DownloadWindows -or $DownloadLinux) Write-Output "INFO: Downloading artifacts from $($LatestRunOfCMakeBuild.artifacts_url)" $ServerResponse = Invoke-WebRequest -Uri $LatestRunOfCMakeBuild.artifacts_url -Headers $GithubApiHeaders | ConvertFrom-Json - $LinuxArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-ubuntu-release-package-on" - $WindowsArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-windows-64-release-msvc-package-on" + $LinuxArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-ubuntu-package-off-Release" + $WindowsArtifact = $ServerResponse.artifacts | Where-Object name -eq "czicompress-windows-64-msvc-package-on-Release" if ($ServerResponse.total_count -eq 0) { throw "No artifacts found." diff --git a/opencppcoverage.txt b/opencppcoverage.txt index bd46f50..d3ef98d 100644 --- a/opencppcoverage.txt +++ b/opencppcoverage.txt @@ -3,3 +3,4 @@ # SPDX-License-Identifier: MIT sources=czicompress modules=czicompress +excluded_sources=czicompress\tests\ \ No newline at end of file From e3c4ebf3ade3dc5c19141733b56611b87e7e3405 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 12:10:47 +0100 Subject: [PATCH 25/30] Update czicompress_cmake.yml --- .github/workflows/czicompress_cmake.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 8e01d56..71deb29 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -50,13 +50,7 @@ jobs: exclude: # From https://github.com/actions/runner/issues/1512 - build: debug - {config: { name: ubuntu-package-off, - os: ubuntu-20.04, - platform: x64-linux, - package: OFF, - path-cache: '/usr/local/share/vcpkg/installed', - path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', - os-id: 'linux',}} + {config: { name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux',}} steps: - name: Checkout the source codes. From de14fddf7562e212e3c750dd9b1604e2de230471 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 12:12:23 +0100 Subject: [PATCH 26/30] Update czicompress_cmake.yml --- .github/workflows/czicompress_cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 71deb29..8d15565 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -50,7 +50,7 @@ jobs: exclude: # From https://github.com/actions/runner/issues/1512 - build: debug - {config: { name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux',}} + config: { name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux',} steps: - name: Checkout the source codes. From dff0d657b94df052bdca29b09c49d5e7a34ef07c Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 14:35:29 +0100 Subject: [PATCH 27/30] Fix MegaLinter and Coverage setup --- .github/codecov.yml | 1 - .github/workflows/czicompress_cmake.yml | 9 +++++---- .github/workflows/czishrink_dotnet.yml | 23 +++++++++++++---------- czishrink/README.md | 3 +-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 48a89f3..6cf675b 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -38,4 +38,3 @@ component_management: - "czishrink/" comment: layout: "header, diff, flags, components" # show component info in the PR comment - diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 8d15565..77d25cf 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -49,8 +49,8 @@ jobs: } exclude: # From https://github.com/actions/runner/issues/1512 - - build: debug - config: { name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux',} + - build: Debug + config: {name: ubuntu-package-off, os: ubuntu-20.04, platform: x64-linux, package: OFF, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', os-id: 'linux'} steps: - name: Checkout the source codes. @@ -75,9 +75,10 @@ jobs: # Coverage collection based on https://about.codecov.io/blog/how-to-set-up-codecov-with-c-plus-plus-and-github-actions/ - name: Prepare Coverage if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} + shell: pwsh run: | - choco install OpenCppCoverage -y - echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH + choco install OpenCppCoverage -y + echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH - name: Get Coverage if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index 86596ac..fdea87b 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -19,23 +19,26 @@ jobs: defaults: run: working-directory: czishrink - name: ${{matrix.config.name}} + name: ${{matrix.config.os}}-${{matrix.build}} runs-on: ${{matrix.config.os}} strategy: fail-fast: false matrix: + build: [Release, Debug] config: - { - name: windows, os: windows-latest, osfamily: win, } - { - name: ubuntu, os: ubuntu-latest, osfamily: linux, } + exclude: + # From https://github.com/actions/runner/issues/1512 + - build: Debug + config: {os: windows-latest, osfamily: win} steps: - uses: actions/checkout@v3 @@ -69,12 +72,12 @@ jobs: run: dotnet restore - name: Build - run: dotnet build --no-restore -c Debug + run: dotnet build --no-restore -c ${{ matrix.build }} - name: Test run: > dotnet test - -c Debug + -c ${{ matrix.build }} --no-build --verbosity normal --logger trx @@ -87,7 +90,7 @@ jobs: -p:Exclude='[netczicompress]netczicompress.Views.*' - name: Upload coverage reports for czishrink to Codecov - if: matrix.config.name == 'ubuntu' + if: ${{ (matrix.config.os == 'ubuntu-latest') && (matrix.build == 'Debug') }} uses: codecov/codecov-action@v3 with: fail_ci_if_error: true @@ -98,16 +101,16 @@ jobs: - name: Upload dotnet test results uses: actions/upload-artifact@v3 with: - name: dotnet-results-${{ matrix.config.name }} + name: dotnet-results-${{ matrix.config.os }} path: TestResults # Use always() to also publish test results when there are test failures if: ${{ always() }} - name: Publish - if: github.event_name == 'push' + if: ${{ (github.event_name == 'push') && (matrix.build == Release) }} run: > dotnet publish netczicompress.Desktop/netczicompress.Desktop.csproj - -c Release + -c ${{ matrix.build }} -a x64 --self-contained -p:PublishSingleFile=true @@ -117,7 +120,7 @@ jobs: - name: Upload published binaries uses: actions/upload-artifact@v3 - if: github.event_name == 'push' + if: ${{ (github.event_name == 'push') && (matrix.build == Release) }} with: name: CziShrink_${{ steps.getversion.outputs.version }}_${{ matrix.config.osfamily}}-x64 path: publish diff --git a/czishrink/README.md b/czishrink/README.md index d913df3..848307a 100644 --- a/czishrink/README.md +++ b/czishrink/README.md @@ -4,7 +4,6 @@ An open source and cross-platform GUI for [CziCompress](https://github.com/ZEISS ## Table of contents - [Overview](#overview) - - [Download](#download) - [System Requirements](#system-requirements) - [Theme Support](#theme-support) - [I/O](#io) @@ -18,7 +17,7 @@ An open source and cross-platform GUI for [CziCompress](https://github.com/ZEISS - [FAQ](#faq) - [Known Issues](#known-issues) - [Potential Future Enhancements](#potential-future-enhancements) - - [Feedback](#feedback) + - [Contributing](#contributing) ## Overview From 88b004d9a1f5ae4125261a0699ed7b701b9860dd Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 14:56:27 +0100 Subject: [PATCH 28/30] Fix quoting issue --- .github/workflows/czishrink_dotnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/czishrink_dotnet.yml b/.github/workflows/czishrink_dotnet.yml index fdea87b..43cef7c 100644 --- a/.github/workflows/czishrink_dotnet.yml +++ b/.github/workflows/czishrink_dotnet.yml @@ -107,7 +107,7 @@ jobs: if: ${{ always() }} - name: Publish - if: ${{ (github.event_name == 'push') && (matrix.build == Release) }} + if: ${{ (github.event_name == 'push') && (matrix.build == 'Release') }} run: > dotnet publish netczicompress.Desktop/netczicompress.Desktop.csproj -c ${{ matrix.build }} @@ -120,7 +120,7 @@ jobs: - name: Upload published binaries uses: actions/upload-artifact@v3 - if: ${{ (github.event_name == 'push') && (matrix.build == Release) }} + if: ${{ (github.event_name == 'push') && (matrix.build == 'Release') }} with: name: CziShrink_${{ steps.getversion.outputs.version }}_${{ matrix.config.osfamily}}-x64 path: publish From 0973d49a23124662d8b3105895d3fe5e79931f89 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Fri, 10 Nov 2023 17:01:15 +0100 Subject: [PATCH 29/30] Add codecov badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 97ac11b..f6d8dcd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # czicompress [![REUSE status](https://api.reuse.software/badge/github.com/ZEISS/czicompress)](https://api.reuse.software/info/github.com/ZEISS/czicompress) [![MegaLinter](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml/badge.svg?branch=main&event=push)](https://github.com/ZEISS/czicompress/actions/workflows/mega-linter.yml) +[![codecov](https://codecov.io/gh/ZEISS/czicompress/graph/badge.svg?token=qxNgNpz4VZ)](https://codecov.io/gh/ZEISS/czicompress) Reduce the size of existing CZI files by converting them to zstd-compressed CZI files. From 0fa271c91a02d7efcece2681c40f9399ad3ed623 Mon Sep 17 00:00:00 2001 From: Felix Scheffler Date: Sat, 11 Nov 2023 09:13:12 +0100 Subject: [PATCH 30/30] Remove opencppcoverage.txt in favor of inlined reference --- .github/workflows/czicompress_cmake.yml | 2 +- czicompress/README.md | 2 +- opencppcoverage.txt | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 opencppcoverage.txt diff --git a/.github/workflows/czicompress_cmake.yml b/.github/workflows/czicompress_cmake.yml index 77d25cf..0314834 100644 --- a/.github/workflows/czicompress_cmake.yml +++ b/.github/workflows/czicompress_cmake.yml @@ -84,7 +84,7 @@ jobs: if: ${{ (matrix.config.os == 'windows-latest') && (matrix.build == 'Debug') }} working-directory: ${{github.workspace}}/czicompress/build/tests/${{matrix.build}} shell: cmd - run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --config_file "${{github.workspace}}\opencppcoverage.txt" -- czicompress_tests.exe + run: OpenCppCoverage.exe --export_type cobertura:${{github.workspace}}\TestResults\coverage.xml --sources "${{github.workspace}}\czicompress" --excluded_sources "${{github.workspace}}\czicompress\tests" --modules czicompress -- czicompress_tests.exe - name: Upload Coverage uses: codecov/codecov-action@v3 diff --git a/czicompress/README.md b/czicompress/README.md index bf4a58f..9e50aac 100644 --- a/czicompress/README.md +++ b/czicompress/README.md @@ -39,7 +39,7 @@ The tool is based on [libczi](https://github.com/ZEISS/libczi.git). We have not yet published any Releases. Meanwhile, you can download binaries from the artifacts of the latest [Build workflow run](https://github.com/ZEISS/czicompress/actions/workflows/czicompress_cmake.yml?query=branch%3Amain). Click on the topmost successful run and download the binaries for your platform: * czicompress-windows-64-msvc-package-on-Release for Windows -* czicompress-ubuntu-llvm-package-off-Release for Linux +* czicompress-ubuntu-package-off-Release for Linux Clicking on these artifacts will download a ZIP file with the executable. The executable is a stand-alone binary. You can put it anywhere you like. diff --git a/opencppcoverage.txt b/opencppcoverage.txt deleted file mode 100644 index d3ef98d..0000000 --- a/opencppcoverage.txt +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: 2017-2022 Carl Zeiss Microscopy GmbH -# -# SPDX-License-Identifier: MIT -sources=czicompress -modules=czicompress -excluded_sources=czicompress\tests\ \ No newline at end of file