-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 2.14 KB
/
Copy pathci.yml
File metadata and controls
54 lines (52 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
build:
# Windows vcpkg builds are slow the first time (OpenSSL, curl, etc.). After that,
# vcpkg restores prebuilt packages from the repo Actions cache via x-gha.
permissions:
contents: read
actions: write
env:
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libssl-dev libcurl4-openssl-dev libsodium-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install openssl curl libsodium
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: vcpkg install openssl:x64-windows curl:x64-windows libsodium:x64-windows
- name: Configure
shell: bash
run: |
extra=()
if [ "$RUNNER_OS" = "Windows" ]; then
root="${VCPKG_INSTALLATION_ROOT:-C:/vcpkg}"
extra+=("-DCMAKE_TOOLCHAIN_FILE=${root}/scripts/buildsystems/vcpkg.cmake")
fi
cmake -S . -B build -DAUTHFORGE_BUILD_VECTOR_GENERATOR=OFF -DAUTHFORGE_BUILD_TESTS=ON "${extra[@]}"
- name: Activation request SDK tag matches CMake version
shell: bash
run: |
set -euo pipefail
CMAKE=$(sed -n 's/^project(AuthForgeCPPSDK VERSION \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' CMakeLists.txt | head -n 1)
TAG=$(sed -n 's/.*kActivationRequestSdkTag = "cpp\/\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)".*/\1/p' authforge_offline.cpp | head -n 1)
if [ -z "$CMAKE" ] || [ -z "$TAG" ] || [ "$CMAKE" != "$TAG" ]; then
echo "CMakeLists VERSION '$CMAKE' does not match kActivationRequestSdkTag cpp/$TAG"
exit 1
fi
- name: Build
run: cmake --build build --config Release
- name: Offline license file conformance (ctest)
run: ctest --test-dir build -C Release --output-on-failure