-
Notifications
You must be signed in to change notification settings - Fork 9
137 lines (117 loc) · 4.71 KB
/
cmake.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: GitHub actions
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
repository_dispatch:
types: [ "**" ]
env:
BUILD_TYPE: Debug
LD_LIBRARY_PATH: /usr/local/lib
WIN_LIBOQS_INSTALL_PATH: C:\liboqs
jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install liboqs POSIX
if: matrix.os != 'windows-latest'
run: |
git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs
cmake -S liboqs -B liboqs/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON
cmake --build liboqs/build --parallel 4
sudo cmake --build liboqs/build --target install
- name: Install liboqs-cpp POSIX
if: matrix.os != 'windows-latest'
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
sudo cmake --build build --target install
- name: Build standalone example POSIX
if: matrix.os != 'windows-latest'
run: |
cmake -B examples/standalone/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build examples/standalone/build --target standalone
- name: Run standalone example POSIX
if: matrix.os != 'windows-latest'
run: |
./examples/standalone/build/standalone
- name: Build the examples POSIX
if: matrix.os != 'windows-latest'
run: |
cmake --build build --target examples --parallel 4
- name: Build the unit tests POSIX
if: matrix.os != 'windows-latest'
run: |
cmake --build build --target unit_tests --parallel 4
- name: Run examples POSIX
if: matrix.os != 'windows-latest'
run: |
./build/kem
echo
./build/sig
echo
./build/rand
- name: Run unit tests POSIX
if: matrix.os != 'windows-latest'
run: GTEST_COLOR=1 ctest -V --test-dir build
- name: Install liboqs Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs
cmake -S liboqs -B liboqs\build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.WIN_LIBOQS_INSTALL_PATH}} -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON
cmake --build liboqs\build --parallel 4
cmake --build liboqs\build --target install
- name: Install liboqs-cpp Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
cmake --build build --target install
- name: Build standalone example Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
cmake -B examples\standalone\build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build examples\standalone\build --target standalone
- name: Run standalone example Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
.\examples\standalone\build\${{env.BUILD_TYPE}}\standalone.exe
- name: Build examples Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLIBOQS_INCLUDE_DIR=${{env.WIN_LIBOQS_INSTALL_PATH}}\include -DLIBOQS_LIB_DIR=${{env.WIN_LIBOQS_INSTALL_PATH}}\lib
cmake --build build --target examples --parallel 4
- name: Build unit tests Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLIBOQS_INCLUDE_DIR=${{env.WIN_LIBOQS_INSTALL_PATH}}\include -DLIBOQS_LIB_DIR=${{env.WIN_LIBOQS_INSTALL_PATH}}\lib
cmake --build build --target unit_tests --parallel 4
- name: Run examples Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
.\build\${{env.BUILD_TYPE}}\kem.exe
echo.
.\build\${{env.BUILD_TYPE}}\sig.exe
echo.
.\build\${{env.BUILD_TYPE}}\rand.exe
- name: Run unit tests Windows
shell: cmd
if: matrix.os == 'windows-latest'
run: |
set PATH=%PATH%;${{env.WIN_LIBOQS_INSTALL_PATH}}\bin
set GTEST_COLOR=1
ctest -V --test-dir build