Skip to content

Add CziShrink

Add CziShrink #5

---
name: CMake Build (czicompress)
on:
push:
branches: ["main"] # run only when merge with main branch
paths: ["czicompress/**"]
pull_request:
branches: ["main"] # run only when merge with main branch
paths: ["czicompress/**"]
workflow_dispatch: {}
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:
run:
working-directory: ${{github.workspace}}/czicompress
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
fail-fast: false
matrix:
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
# }
- {
name: windows-64-release-msvc-package-on,
os: windows-latest,
platform: x64-windows-static,
package: ON,
path-cache: '${{ github.workspace }}\vcpkg\installed',
path-toolchain: 'C:/vcpkg/scripts/buildsystems/vcpkg.cmake',
os-id: 'windows',
}
- {
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.
uses: actions/checkout@v3
- uses: ./.github/actions/cmake-build
with:
path-cache: ${{matrix.config.path-cache}}
path-toolchain: ${{matrix.config.path-toolchain}}
os-id: ${{matrix.config.os-id}}
build-type: ${{env.BUILD_TYPE}}
package: ${{matrix.config.package}}
platform: ${{matrix.config.platform}}
src-dir: '${{github.workspace}}/czicompress'
- name: Run unit tests
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}}
- name: Prepare licenses
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}}/
# gather the binaries
- name: Prepare Linux binaries
if: matrix.config.os == 'ubuntu-20.04'
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'
shell: bash
run: |
cp ./build/app/${{env.BUILD_TYPE}}/*.exe ./build/capi/${{env.BUILD_TYPE}}/libczicompressc.dll ./czicompress-${{matrix.config.name}}/
# upload the build-results to artifacts-store
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: czicompress-${{matrix.config.name}}
path: czicompress/czicompress-${{matrix.config.name}}/