-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (88 loc) · 3.09 KB
/
Copy pathci.yml
File metadata and controls
100 lines (88 loc) · 3.09 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-gcc-debug
os: ubuntu-latest
generator: Ninja
build_type: Debug
c_compiler: gcc
differential: ON
- name: ubuntu-clang-release
os: ubuntu-latest
generator: Ninja
build_type: Release
c_compiler: clang
differential: ON
- name: windows-msvc-release
os: windows-latest
generator: Ninja
arch: ''
build_type: Release
c_compiler: cl
differential: OFF
- name: macos-clang-release
os: macos-latest
generator: Ninja
build_type: Release
c_compiler: clang
differential: OFF
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install OpenSSL dev package
if: matrix.differential == 'ON' && runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libssl-dev
- name: Setup MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Configure
shell: bash
run: |
cmake -S . -B build -G "${{ matrix.generator }}" \
${{ matrix.arch != '' && format('-A {0}', matrix.arch) || '' }} \
-DMICROCRYPT_BUILD_TESTS=ON \
-DMICROCRYPT_BUILD_DIFFERENTIAL_TESTS=${{ matrix.differential }} \
-DMICROCRYPT_STRICT_WARNINGS=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.c_compiler != '' && format('-DCMAKE_C_COMPILER={0}', matrix.c_compiler) || '' }}
- name: Build
shell: bash
run: cmake --build build --config ${{ matrix.build_type }} --parallel
- name: Test
shell: bash
run: ctest --test-dir build --output-on-failure ${{ runner.os == 'Windows' && format('-C {0}', matrix.build_type) || '' }}
- name: Install
shell: bash
run: cmake --install build --config ${{ matrix.build_type }} --prefix "${{ github.workspace }}/stage"
- name: Configure consumer
shell: bash
run: |
cmake -S tests/consumer -B build-consumer -G "${{ matrix.generator }}" \
${{ matrix.arch != '' && format('-A {0}', matrix.arch) || '' }} \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/stage" \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.c_compiler != '' && format('-DCMAKE_C_COMPILER={0}', matrix.c_compiler) || '' }}
- name: Build consumer
shell: bash
run: cmake --build build-consumer --config ${{ matrix.build_type }} --parallel
- name: Run consumer
shell: bash
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
build-consumer/consumer.exe
else
./build-consumer/consumer
fi