Fix ASiC-E/S CAdES signature save #2075
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| env: | |
| BUILD_NUMBER: ${{ github.run_number }} | |
| CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
| # Required dependencies (does not include packaging and optional dependencies) | |
| FEDORA_DEPS: cmake gcc-c++ libtool-ltdl-devel libxml2-devel minizip-ng-compat-devel zlib-devel xmlsec1-openssl-devel | |
| UBUNTU_DEPS: cmake libxml2-dev libxmlsec1-dev zlib1g-dev | |
| jobs: | |
| macos: | |
| name: Build on macOS for ${{ matrix.target }} | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| target: [macos, iphoneos, iphonesimulator] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install dependencies | |
| run: | | |
| brew update | |
| brew install --formula swig doxygen boost | |
| brew unlink [email protected] || true | |
| brew unlink [email protected] || true | |
| brew unlink openssl@3 || true | |
| brew unlink xz | |
| sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.13 | |
| sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.14 | |
| - name: Cache | |
| uses: actions/cache@v4 | |
| id: cache | |
| with: | |
| path: cache | |
| key: ${{ matrix.target }}-${{ hashFiles('prepare_osx_build_environment.sh') }} | |
| - name: Build openssl | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: ./prepare_osx_build_environment.sh openssl ${{ matrix.target }} | |
| - name: Build xmlsec | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: ./prepare_osx_build_environment.sh xmlsec ${{ matrix.target }} | |
| - name: Move to cache | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir cache | |
| sudo mv /Library/libdigidocpp* cache | |
| - name: Setup cache | |
| run: sudo ln -s $PWD/cache/* /Library/ | |
| - name: Build macOS | |
| if: matrix.target == 'macos' | |
| run: | | |
| cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo | |
| cmake --build --preset ${{ matrix.target }} | |
| cmake --build --preset ${{ matrix.target }} --target test pkcs11sign embedlibs | |
| cmake --build --preset ${{ matrix.target }} --target zipdebug pkgbuild | |
| - name: Build ${{ matrix.target }} | |
| if: matrix.target != 'macos' | |
| run: | | |
| cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo | |
| cmake --build --preset ${{ matrix.target }} | |
| sudo cmake --build --preset ${{ matrix.target }} --target install/strip | |
| cd /Library | |
| zip -q -r ${OLDPWD}/libdigidocpp.${{ matrix.target }}.zip libdigidocpp.* | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ matrix.target }} | |
| path: | | |
| build/*/libdigidocpp*.* | |
| libdigidocpp*.zip | |
| android: | |
| name: Build on Ubuntu for ${{ matrix.target }} | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| include: | |
| - target: androidarm | |
| triplet: arm-neon-android | |
| - target: androidarm64 | |
| triplet: arm64-android | |
| - target: androidx86_64 | |
| triplet: x64-android | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Cache vcpkg | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/vcpkg_cache | |
| key: vcpkg-${{ matrix.target }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }} | |
| - name: Build | |
| env: | |
| VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite | |
| run: | | |
| export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT | |
| export ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME | |
| export ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME | |
| cmake --preset ${{ matrix.target }} "-GUnix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo | |
| cmake --build --preset ${{ matrix.target }} | |
| cmake --build --preset ${{ matrix.target }} --target install/strip | |
| zip -q -r libdigidocpp.${{ matrix.target }}.zip libdigidocpp.${{ matrix.target }} | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ matrix.target }} | |
| path: | | |
| libdigidocpp*.zip | |
| fedora: | |
| name: Build on Fedora ${{ matrix.container }} | |
| runs-on: ubuntu-latest | |
| container: fedora:${{ matrix.container }} | |
| strategy: | |
| matrix: | |
| container: [42, 43, rawhide] | |
| steps: | |
| - name: Install Deps | |
| run: | | |
| dnf install -y --setopt=install_weak_deps=False \ | |
| ${FEDORA_DEPS} doxygen boost-test swig python3-devel java-21-openjdk-devel rpm-build | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Build | |
| run: | | |
| cmake -DCMAKE_INSTALL_SYSCONFDIR=/etc -B build -S . | |
| cmake --build build | |
| cmake --build build --target package | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: fedora_${{ matrix.container }} | |
| path: build/libdigidocpp*.rpm | |
| ubuntu: | |
| name: Build on ${{ matrix.dist }} ${{ matrix.ver }} ${{ matrix.arch }} | |
| runs-on: ubuntu-24.04${{ matrix.arch == 'arm64' && '-arm' || '' }} | |
| container: ${{ matrix.dist }}:${{ matrix.ver }} | |
| strategy: | |
| matrix: | |
| dist: [ubuntu] | |
| ver: ['22.04', '24.04', '25.04', '25.10'] | |
| arch: [amd64, arm64] | |
| java: [17] | |
| include: [ | |
| { dist: debian, ver: 'bookworm', arch: amd64, java: 17 }, | |
| { dist: debian, ver: 'trixie', arch: amd64, java: 21 }, | |
| ] | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| DEBFULLNAME: github-actions | |
| DEBEMAIL: [email protected] | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| echo 'path-exclude=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/99-nodocs | |
| echo 'path-exclude=/usr/share/doc/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs | |
| echo 'path-exclude=/usr/share/doc-base/*' >> /etc/dpkg/dpkg.cfg.d/99-nodocs | |
| apt update -qq && apt install --no-install-recommends -y lsb-release build-essential devscripts debhelper lintian pkg-config ${UBUNTU_DEPS} doxygen swig openjdk-${{ matrix.java }}-jdk-headless libpython3-dev python3-setuptools libboost-test-dev | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup changelog | |
| run: | | |
| export VERSION=$(grep project CMakeLists.txt | egrep -o "([0-9]{1,}\.)+[0-9]{1,}") | |
| export VERSIONEX=${VERSION}.${BUILD_NUMBER}.$(lsb_release -rs) | |
| dch --distribution $(lsb_release -cs) -v ${VERSIONEX} "Release ${VERSIONEX}." | |
| - name: Build packages | |
| run: | | |
| JAVA_HOME=/usr/lib/jvm/java-${{ matrix.java }}-openjdk-${{ matrix.arch }} dpkg-buildpackage -us -uc | |
| mv ../libdigidocpp*.* . | |
| - name: Lintian | |
| run: lintian *.deb; | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ matrix.dist }}_${{ matrix.ver }}_${{ matrix.arch }} | |
| path: libdigidocpp*.* | |
| windows: | |
| name: Build on Windows | |
| runs-on: windows-2025 | |
| strategy: | |
| matrix: | |
| toolset: [143] | |
| platform: [x86, x64, arm64] | |
| include: | |
| - platform: x86 | |
| setenv: amd64_x86 | |
| - platform: x64 | |
| setenv: amd64 | |
| - platform: arm64 | |
| setenv: amd64_arm64 | |
| env: | |
| VER_SUFFIX: .VS${{ matrix.toolset }} | |
| CXXFLAGS: '/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR' # https://github.com/actions/runner-images/issues/10004 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Cache vcpkg | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/vcpkg_cache | |
| key: vcpkg-${{ matrix.toolset }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json', 'vcpkg-ports/**') }} | |
| - name: Install dependencies | |
| run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - uses: actions/setup-python@v5 | |
| if: matrix.platform != 'arm64' | |
| with: | |
| python-version: 3.12 | |
| architecture: ${{ matrix.platform }} | |
| - name: Build | |
| env: | |
| VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite | |
| run: | | |
| $swig = (Get-Item "$env:LOCALAPPDATA\Microsoft\WinGet\Links\swig.exe").Target | |
| & "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" ${{ matrix.setenv }} "&&" pwsh build.ps1 ` | |
| -vcpkg "C:/vcpkg/vcpkg.exe" ` | |
| -swig $swig ` | |
| -doxygen "C:/Program files/doxygen/bin/doxygen.exe" ` | |
| -boost | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: msi_${{ matrix.toolset }}_${{ matrix.platform }} | |
| path: ./*.msi | |
| pages: | |
| name: Deploy pages | |
| if: github.repository == 'open-eid/libdigidocpp' && contains(github.ref, 'master') | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install dependencies | |
| run: sudo apt update -qq && sudo apt install --no-install-recommends -y doxygen ${UBUNTU_DEPS} | |
| - name: Build docs | |
| run: | | |
| cmake -B build -S . | |
| cmake --build build --target docs | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./build/doc | |
| force_orphan: true | |
| coverity: | |
| name: Run Coverity tests | |
| if: github.repository == 'open-eid/libdigidocpp' && contains(github.ref, 'coverity_scan') | |
| runs-on: ubuntu-24.04 | |
| env: | |
| TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
| PROJECTNAME: ${{ github.repository }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install dependencies | |
| run: sudo apt update -qq && sudo apt install --no-install-recommends -y curl ca-certificates ${UBUNTU_DEPS} | |
| - name: Download Coverity Build Tool | |
| run: | | |
| curl --silent --data "token=$TOKEN&project=$PROJECTNAME" -o cov-analysis-linux64.tar.gz https://scan.coverity.com/download/cxx/linux64 | |
| mkdir cov-analysis-linux64 | |
| tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 | |
| - name: Build | |
| run: | | |
| cmake -B build -S . \ | |
| -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=YES \ | |
| -DCMAKE_DISABLE_FIND_PACKAGE_Boost=YES \ | |
| -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=YES | |
| export PATH=$PWD/cov-analysis-linux64/bin:$PATH | |
| cov-build --dir cov-int cmake --build build | |
| - name: Submit the result to Coverity Scan | |
| run: | | |
| tar czvf upload.tgz cov-int | |
| curl --silent \ | |
| --form project=$PROJECTNAME \ | |
| --form token=$TOKEN \ | |
| --form [email protected] \ | |
| --form [email protected] \ | |
| --form version=master \ | |
| --form description="Github Actions CI build" \ | |
| https://scan.coverity.com/builds?project=$PROJECTNAME | |
| codeql: | |
| name: Run CodeQL tests | |
| if: github.repository == 'open-eid/libdigidocpp' | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| security-events: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install dependencies | |
| run: sudo apt update -qq && sudo apt install --no-install-recommends -y ${UBUNTU_DEPS} | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| languages: cpp | |
| queries: +security-and-quality | |
| - name: Build | |
| run: | | |
| cmake -B build -S . \ | |
| -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=YES \ | |
| -DCMAKE_DISABLE_FIND_PACKAGE_Boost=YES \ | |
| -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=YES \ | |
| -DBUILD_TOOLS=NO | |
| cmake --build build | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4 | |
| with: | |
| upload: False | |
| output: sarif-results | |
| - name: Filter results | |
| uses: advanced-security/filter-sarif@v1 | |
| with: | |
| patterns: | | |
| -src/json.hpp | |
| -src/minizip/* | |
| -**:cpp/poorly-documented-function | |
| -**:cpp/loop-variable-changed | |
| input: sarif-results/cpp.sarif | |
| output: sarif-results/cpp.sarif | |
| - name: Upload results | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: sarif-results/cpp.sarif |