Skip to content

v3

v3 #405

Workflow file for this run

# Any changes to .github/workflows/ci.yml will be overwritten.
# Modify .github/workflows/ci.yml.in instead.
name: CI
on:
push:
pull_request:
workflow_dispatch:
env:
version: 0.4.19_git
OPENSSL_VERSION: 4.0.0
HOMEBREW_NO_AUTO_UPDATE: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- id: ubuntu-latest
triplet: x64-linux
compiler: gcc
os: ubuntu-latest
generator: Unix Makefiles
- id: ubuntu-24.04
triplet: x64-linux
compiler: gcc
os: ubuntu-24.04
generator: Unix Makefiles
- id: ubuntu-22.04
triplet: x64-linux
compiler: gcc
os: ubuntu-22.04
generator: Unix Makefiles
- id: macOS-4
openssl: 'openssl@4'
triplet: x64-osx
compiler: clang
os: macos-26
generator: Unix Makefiles
- id: macOS-3
openssl: 'openssl@3'
triplet: x64-osx
compiler: clang
os: macOS-latest
generator: Unix Makefiles
- id: macOS-1.1
openssl: 'openssl@1.1'
triplet: x64-osx
compiler: clang
os: macOS-latest
generator: Unix Makefiles
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v5
- name: Install apt dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev opensc softhsm2
- name: Restore cached OpenSSL 4 (ubuntu-latest only)
if: matrix.id == 'ubuntu-latest'
id: cache-openssl4
uses: actions/cache@v5
with:
path: ~/openssl-4
key: ${{ runner.os }}-${{ matrix.id }}-openssl-${{ env.OPENSSL_VERSION }}
- name: Build OpenSSL 4 (ubuntu-latest only)
if: matrix.id == 'ubuntu-latest' && steps.cache-openssl4.outputs.cache-hit != 'true'
run: |
curl -LO https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
tar xf openssl-4.0.0.tar.gz
cd openssl-4.0.0
./Configure linux-x86_64 --prefix="$HOME/openssl-4" --openssldir="$HOME/openssl-4"
make -j"$(nproc)"
make install
- name: Set environment variables (ubuntu-latest only)
if: matrix.id == 'ubuntu-latest'
run: |
echo "$HOME/openssl-4/bin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=$HOME/openssl-4/lib64/pkgconfig:$HOME/openssl-4/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/openssl-4/lib64:$HOME/openssl-4/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Remove unused Homebrew taps (macOS)
if: runner.os == 'macOS'
run: |
# GitHub-hosted macOS images may include unrelated third-party taps
# that trigger trust warnings on every brew command.
brew untap --force aws/tap azure/bicep hashicorp/tap >/dev/null 2>&1 || true
- name: Install brew build dependencies (macOS)
if: runner.os == 'macOS'
run: |
for package in libtool automake; do
if ! brew list --versions "$package" >/dev/null; then
brew install "$package"
fi
done
- name: Install brew test dependencies (macOS)
if: runner.os == 'macOS' && matrix.id != 'macOS-4'
run: |
for package in opensc softhsm; do
if ! brew list --versions "$package" >/dev/null; then
brew install "$package"
fi
done
- name: Install OpenSSL 4 (macOS-4 only)
if: runner.os == 'macOS' && matrix.id == 'macOS-4'
run: |
if ! brew list --versions openssl@4 >/dev/null; then
brew install --quiet openssl@4
fi
- name: Install OpenSSL 3 (macOS-3 only)
if: runner.os == 'macOS' && matrix.id == 'macOS-3'
run: |
if ! brew list --versions openssl@3 >/dev/null; then
brew install openssl@3
fi
- name: Set environment variables (macOS)
if: runner.os == 'macOS'
run: |
echo "/opt/homebrew/bin" >> $GITHUB_PATH
echo "/opt/homebrew/opt/${{matrix.openssl}}/bin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=/opt/homebrew/opt/${{matrix.openssl}}/lib/pkgconfig" >> $GITHUB_ENV
- name: System information
run: |
which pkcs11-tool || true
which softhsm2-util || true
which openssl
openssl version -a
echo "PATH=$PATH"
- name: Bootstrap
run: autoreconf --verbose --install --force
- name: Configure
run: ./configure --enable-strict
- name: Build
run: make
- name: Test
timeout-minutes: 5
run: make check
- name: Results of tests
run: cat ${{github.workspace}}/tests/test-suite.log || true
windows:
strategy:
fail-fast: false
matrix:
include:
- id: windows-x86-vs
triplet: x86-windows
build_for: 'WIN32'
compiler: vs
arch: x86
os: windows-2022
generator: Ninja
vcpkg_root: C:/vcpkg
- id: windows-x64-vs
triplet: x64-windows
build_for: 'WIN64'
compiler: vs
arch: x64
os: windows-2022
generator: Ninja
vcpkg_root: C:/vcpkg
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v5
- name: Cache the vcpkg archives
uses: actions/cache@v5
with:
path: C:/Users/runneradmin/AppData/Local/vcpkg/archives
key: ${{matrix.id}}-${{hashFiles('vcpkg.json')}}
restore-keys: |
${{matrix.id}}-${{hashFiles('vcpkg.json')}}
${{matrix.id}}-
- name: Configure Visual Studio
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: ${{matrix.arch}}
- name: Install OpenSSL with VCPKG
run: |
vcpkg install --triplet=${{matrix.triplet}} openssl[tools]
echo "C:\vcpkg\packages\openssl_${{matrix.triplet}}\tools\openssl" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: System information
run: openssl version -a
- name: Build
run: nmake -f Makefile.mak
BUILD_FOR=${{matrix.build_for}}
OPENSSL_DIR="C:\vcpkg\packages\openssl_${{matrix.triplet}}"
- name: Upload the DLLs
uses: actions/upload-artifact@v6
with:
name: libp11-${{env.version}}-${{matrix.arch}}
path: ${{github.workspace}}/src/*.dll