Added gpg version selector #4
Workflow file for this run
This file contains 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: centos-and-fedora | |
on: | |
push: | |
branches: | |
- main | |
- maxirmx-refactor-centos | |
- 'release/**' | |
paths-ignore: | |
- '/*.sh' | |
- '/.*' | |
- '/_*' | |
- 'Brewfile' | |
- 'docs/**' | |
- '**.adoc' | |
- '**.md' | |
- '**.nix' | |
- 'flake.lock' | |
- '.github/workflows/*.yml' | |
- '!.github/workflows/centos-and-fedora-new.yml' | |
pull_request: | |
paths-ignore: | |
- '/*.sh' | |
- '/.*' | |
- '/_*' | |
- 'Brewfile' | |
- 'docs/**' | |
- '**.adoc' | |
- '**.md' | |
- '**.nix' | |
- 'flake.lock' | |
concurrency: | |
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' | |
cancel-in-progress: true | |
env: | |
CORES: 2 | |
RNP_LOG_CONSOLE: 1 | |
jobs: | |
tests: | |
name: ${{ matrix.image.container }} [CC ${{ matrix.env.CC }}; backend ${{ matrix.image.backend }}; ${{ matrix.image.gpg_ver }}] | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'skip ci')" | |
timeout-minutes: 120 | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- { CC: gcc, CXX: g++, BUILD_MODE: normal } | |
# normal --> Release build; sanitize --> Debug build so theoretically test conditions are different | |
# - { CC: clang, CXX: clang++, BUILD_MODE: normal } | |
- { CC: clang, CXX: clang++, BUILD_MODE: sanitize } | |
image: | |
- { container: 'centos-7-amd64', backend: 'Botan', gpg_ver: 'stable' } | |
- { container: 'centos-8-amd64', backend: 'Botan', gpg_ver: 'system' } | |
- { container: 'centos-9-amd64', backend: 'Botan', gpg_ver: 'system' } | |
- { container: 'fedora-35-amd64', backend: 'Botan', gpg_ver: 'system' } | |
- { container: 'fedora-36-amd64', backend: 'Botan', gpg_ver: 'system' } | |
- { container: 'fedora-35-amd64', backend: 'OpenSSL', gpg_ver: 'system' } | |
- { container: 'fedora-36-amd64', backend: 'OpenSSL', gpg_ver: 'system' } | |
container: ghcr.io/maxirmx/ci-rnp-${{ matrix.image.container }} | |
env: ${{ matrix.env }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup environment | |
shell: bash | |
run: | | |
- name: Setup environment | |
run: | | |
set -o errexit -o pipefail -o noclobber -o nounset | |
backend=${{ matrix.image.backend }} | |
backend="$(echo "${backend:-}" | tr '[:upper:]' '[:lower:]')" | |
echo CRYPTO_BACKEND="$backend" >> $GITHUB_ENV | |
gpg_ver=${{ matrix.image.gpg_ver }} | |
gpg_ver="$(echo "${gpg_ver:-}" | tr '[:upper:]' '[:lower:]')" | |
if [[ gpg_ver != 'system' ]]; then | |
echo "/opt/gpg/$gpg_ver/bin" >> $GITHUB_PATH | |
fi | |
useradd rnpuser | |
printf "\nrnpuser\tALL=(ALL)\tNOPASSWD:\tALL" > /etc/sudoers.d/rnpuser | |
printf "\nrnpuser\tsoft\tnproc\tunlimited\n" > /etc/security/limits.d/30-rnpuser.conf | |
- name: Configure | |
run: | | |
cmake -B build \ | |
-DBUILD_SHARED_LIBS=ON \ | |
-DCRYPTO_BACKEND=${{ matrix.image.backend }} \ | |
-DDOWNLOAD_GTEST=ON \ | |
-DCMAKE_BUILD_TYPE=Release . | |
- name: Build | |
run: cmake --build build --parallel ${{ env.CORES }} | |
- name: Test | |
run: | | |
mkdir -p "build/Testing/Temporary" | |
cp "cmake/CTestCostData.txt" "build/Testing/Temporary" | |
export PATH="$PWD/build/src/lib:$PATH" | |
chown -R rnpuser:rnpuser $PWD | |
exec su rnpuser -c "ctest --parallel ${{ env.CORES }} --test-dir build --output-on-failure" |