-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (57 loc) · 2.1 KB
/
build_and_test.yml
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
55
56
57
58
59
60
name: C/C++ CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: "OSX clang shared library using LibreSSL"
os: macos-latest
generator: -G "Unix Makefiles"
libressl: -DOPENSSL_ROOT_DIR:PATH=build/external/libressl/install
type: Debug
- name: "OSX clang shared library using OpenSSL"
os: macos-latest
generator: -G "Unix Makefiles"
type: Debug
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: cache externals restore
id: cache-externals-restore
if: matrix.libressl
uses: actions/cache/restore@v3
with:
path: build/external/libressl/install
key: ${{ matrix.os }}-externals-${{ hashFiles('external/CMakeLists.txt') }}
- name: configure externals
if: matrix.libressl && (steps.cache-externals-restore.outputs.cache-hit != 'true')
run: cmake -B build/external -S external ${{ matrix.generator }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.type }}
- name: build externals
if: matrix.libressl && (steps.cache-externals-restore.outputs.cache-hit != 'true')
run: cmake --build build/external --config ${{ matrix.type }}
- name: cache externals save
id: cache-externals-save
if: matrix.libressl
uses: actions/cache/save@v3
with:
path: build/external/libressl/install
key: ${{ steps.cache-externals-restore.outputs.cache-primary-key }}
- name: configure library
run: >
cmake -B build -S . ${{ matrix.generator }}
-DBUILD_SHARED_LIBS:BOOL=ON
-DWITH_TLS:BOOL=ON
${{ matrix.libressl }}
-DCMAKE_BUILD_TYPE:STRING=${{ matrix.type }}
- name: build library
run: cmake --build build --config ${{ matrix.type }}
- name: build & run tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: cmake --build build --target run_tests --config ${{ matrix.type }}