Skip to content

Commit

Permalink
Merge commit 'e67faa5e22b398c81adddc4bbf640b1cbe9d509f' into copy
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed May 6, 2024
2 parents 2243d59 + e67faa5 commit c46dd1b
Show file tree
Hide file tree
Showing 63 changed files with 2,030 additions and 1,592 deletions.
120 changes: 56 additions & 64 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permissions:
contents: read
env:
BUILD_NUMBER: ${{ github.run_number }}
MAKEFLAGS: -j3
CMAKE_BUILD_PARALLEL_LEVEL: 4
jobs:
macos:
name: Build on macOS for ${{ matrix.target }}
Expand All @@ -14,7 +14,7 @@ jobs:
target: [osx, ios, iossimulator, androidarm, androidarm64, androidx86_64]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
Expand All @@ -23,9 +23,12 @@ jobs:
run: |
brew update
brew install doxygen boost xsd || brew link --overwrite xsd
brew unlink xerces-c python@3.10 python@3.11
brew unlink xerces-c
brew unlink python@3.10 || true
brew unlink python@3.11 || true
brew unlink python@3.12 || true
- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
id: cache
with:
path: cache
Expand Down Expand Up @@ -60,33 +63,36 @@ jobs:
zip -q -r ${OLDPWD}/libdigidocpp.${{ matrix.target }}.zip libdigidocpp.*
- name: Archive artifacts
if: matrix.target == 'osx'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pkgs
name: macOS
path: macOS/libdigidocpp*.*
- name: Archive artifacts
if: matrix.target != 'osx'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: libdigidocpp*.zip
fedora:
name: Build on Fedora to ${{ matrix.container }}
name: Build on Fedora ${{ matrix.container }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
container: fedora:${{ matrix.container }}
strategy:
matrix:
container: ['fedora:37', 'fedora:38']
env:
MAKEFLAGS: -j3
container: [38, 39, 40]
steps:
- name: Install Deps
run: |
dnf install -y --setopt=install_weak_deps=False \
git gcc-c++ cmake rpm-build xml-security-c-devel zlib-devel vim-common doxygen boost-test swig python3-devel java-1.8.0-openjdk-devel \
https://www.codesynthesis.com/download/xsd/4.0/linux-gnu/x86_64/xsd-4.0.0-1.x86_64.rpm
git gcc-c++ cmake rpm-build xml-security-c-devel zlib-devel vim-common doxygen boost-test swig python3-devel java-1.8.0-openjdk-devel xsd minizip-devel
- name: Install CMake
if: matrix.container == 39
run: |
dnf install -y --setopt=install_weak_deps=False wget
wget -q https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-x86_64.sh
sh cmake-3.28.1-linux-x86_64.sh --skip-license --prefix=/usr/local
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
Expand All @@ -95,26 +101,26 @@ jobs:
cmake --build build
cmake --build build --target package
- name: Archive artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: rpms
name: fedora_${{ matrix.container }}
path: build/libdigidocpp*.rpm
ubuntu:
name: Build on Ubuntu to ${{ matrix.container }}
name: Build on Ubuntu ${{ matrix.container }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
container: ubuntu:${{ matrix.container }}
strategy:
matrix:
container: ['ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:23.10']
container: ['20.04', '22.04', '23.10', '24.04']
env:
DEBIAN_FRONTEND: noninteractive
DEBFULLNAME: github-actions
DEBEMAIL: github-actions@github.com
steps:
- name: Install dependencies
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper cmake xxd xsdcxx libxml-security-c-dev zlib1g-dev doxygen swig openjdk-8-jdk-headless libpython3-dev python3-distutils libboost-test-dev lintian
run: apt update -qq && apt install --no-install-recommends -y git lsb-release build-essential devscripts debhelper cmake xxd xsdcxx libxml-security-c-dev zlib1g-dev doxygen swig openjdk-8-jdk-headless libpython3-dev python3-setuptools libboost-test-dev lintian
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup changelog
Expand All @@ -129,16 +135,17 @@ jobs:
- name: Lintian
run: lintian *.deb;
- name: Archive artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: debs
name: ubuntu_${{ matrix.container }}
path: libdigidocpp*.*
windows:
name: Build on Windows
runs-on: ${{ matrix.image }}
strategy:
matrix:
toolset: [143, 142]
platform: [x86, x64]
include:
- toolset: 143
image: windows-2022
Expand All @@ -147,62 +154,47 @@ jobs:
image: windows-2019
vcvars: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat"
env:
MAKEFLAGS: ""
VER_SUFFIX: .VS${{ matrix.toolset }}
VERSION: 3.17.0.${{ github.run_number }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- uses: mad9000/actions-find-and-replace-string@3
id: path
with:
source: ${{ github.workspace }}
find: '\'
replace: '/'
replaceAll: true
- name: Prepare vcpkg X64
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 6a349fe1fbea1e5fcda2e0775f555d829a5e82df
vcpkgJsonGlob: ${{ steps.path.outputs.value }}/vcpkg.json
runVcpkgInstall: true
runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]"
env:
VCPKG_DEFAULT_TRIPLET: x64-windows-v${{ matrix.toolset }}
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
- name: Prepare vcpkg X86
- name: Prepare vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 6a349fe1fbea1e5fcda2e0775f555d829a5e82df
vcpkgJsonGlob: ${{ steps.path.outputs.value }}/vcpkg.json
vcpkgGitCommitId: 1f619be01b436b796dab797dd1e1721c5676f8ac
vcpkgJsonGlob: ./vcpkg.json
runVcpkgInstall: true
runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]"
env:
VCPKG_DEFAULT_TRIPLET: x86-windows-v${{ matrix.toolset }}
VCPKG_DEFAULT_TRIPLET: ${{ matrix.platform }}-windows
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
- name: Install dependencies
run: choco install doxygen.install swig -y > $null
- uses: actions/setup-python@v4
run: choco install doxygen.install -y > $null
- uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: x86
architecture: ${{ matrix.platform }}
- name: Build xsd
run: .\prepare_win_build_environment.ps1 -xsd
- name: Install WiX
run: |
dotnet tool install -g wix --version 5.0.0
wix extension -g add WixToolset.UI.wixext/5.0.0
- name: Build
run: |
& .\build.ps1 `
-msiversion $env:VERSION `
-toolset ${{ matrix.toolset }} `
-vcpkg_installed ${{ github.workspace }}/vcpkg_installed `
-vcvars "${{ matrix.vcvars }}" `
-platform ${{ matrix.platform }} `
-swig C:/ProgramData/chocolatey/bin/swig.exe `
-doxygen "C:/Program files/doxygen/bin/doxygen.exe" `
-boost
- name: Archive artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: msi
name: msi_${{ matrix.toolset }}_${{ matrix.platform }}
path: ./*.msi
pages:
name: Deploy pages
Expand All @@ -212,7 +204,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
Expand All @@ -236,7 +228,7 @@ jobs:
PROJECTNAME: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
Expand All @@ -250,7 +242,7 @@ jobs:
run: |
cmake .
export PATH=$PWD/cov-analysis-linux64/bin:$PATH
cov-build --dir cov-int make
cov-build --dir cov-int cmake --build .
- name: Submit the result to Coverity Scan
run: |
tar czvf upload.tgz cov-int
Expand All @@ -265,18 +257,18 @@ jobs:
codeql:
name: Run CodeQL tests
if: github.repository == 'open-eid/libdigidocpp'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake vim-common xsdcxx libxml-security-c-dev zlib1g-dev curl ca-certificates
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake xxd xsdcxx libxml-security-c-dev zlib1g-dev curl ca-certificates
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: cpp
queries: +security-and-quality
Expand All @@ -289,7 +281,7 @@ jobs:
-DBUILD_TOOLS=NO
cmake --build build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
upload: False
output: sarif-results
Expand All @@ -305,6 +297,6 @@ jobs:
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload results
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/cpp.sarif
4 changes: 0 additions & 4 deletions .lgtm.yml

This file was deleted.

12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
cmake_minimum_required(VERSION 3.16)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/cmake/modules/VersionInfo.cmake)
message(FATAL_ERROR "cmake submodule directory empty, did you 'git clone --recursive'?")
endif()

if(POLICY CMP0122)
cmake_policy(SET CMP0122 NEW)
cmake_policy(SET CMP0122 NEW)
endif()
project(libdigidocpp VERSION 3.17.1)
project(libdigidocpp VERSION 3.18.0)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)

include(VersionInfo)
Expand All @@ -16,6 +20,8 @@ set_env( TSL_CERTS
${CMAKE_SOURCE_DIR}/etc/tl-mp4.crt
${CMAKE_SOURCE_DIR}/etc/tl-mp5.crt
${CMAKE_SOURCE_DIR}/etc/tl-mp6.crt
${CMAKE_SOURCE_DIR}/etc/tl-mp7.crt
${CMAKE_SOURCE_DIR}/etc/tl-mp8.crt
CACHE FILEPATH "TSL trust list signing certificates" )
set_env( TSA_URL "http://dd-at.ria.ee/tsa" CACHE STRING "Default TSA URL" )
set_env( SIVA_URL "https://siva.eesti.ee/V3/validate" CACHE STRING "Default SiVa validation service URL" )
Expand Down Expand Up @@ -48,7 +54,7 @@ find_package(ZLIB REQUIRED)
find_package(MiniZip 1 QUIET) # version range (0...<2.0.0) requires CMake>=3.19
if(UNIX AND NOT APPLE)
find_package(PkgConfig)
pkg_check_modules(MINIZIP minizip IMPORTED_TARGET minizip<2.0.0)
pkg_check_modules(MINIZIP minizip IMPORTED_TARGET)
endif()
find_package(SWIG)
find_package(JNI)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Ubuntu
sudo apt install cmake xxd libxml-security-c-dev xsdcxx libssl-dev zlib1g-dev
# Fedora
sudo dnf install cmake gcc-c++ openssl-devel xerces-c-devel xml-security-c-devel zlib-devel vim-common https://www.codesynthesis.com/download/xsd/4.0/linux-gnu/x86_64/xsd-4.0.0-1.x86_64.rpm
sudo dnf install cmake gcc-c++ openssl-devel xerces-c-devel xml-security-c-devel xsd zlib-devel vim-common

* doxygen - Optional, for API documentation
* libboost-test-dev - Optional, for unittests
Expand Down
Loading

0 comments on commit c46dd1b

Please sign in to comment.