-
Notifications
You must be signed in to change notification settings - Fork 14
106 lines (91 loc) · 2.8 KB
/
main.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
name: CMake
on: [pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-18.04, windows-2019, macos-10.15]
os: [ubuntu-18.04, windows-2019]
# os: [ubuntu-18.04]
USE_CONTEXT: ["ON", "OFF"]
CMAKE_OPTIONS:
[
"-DCN_CBOR_NO_FLOATS=ON",
"-DCN_CBOR_ALIGN_READS=ON",
"-DCN_CBOR_OPTIMIZE=ON"
]
steps:
- uses: actions/checkout@v1
- name: setup (linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt install cmake-data
# - name: setup (mac)
# if: startsWith(matrix.os, 'macos')
# run: |
# brew update
# brew upgrade
# brew install cmake openssl
# - name: setup (windows)
# if: startsWith(matrix.os, 'windows')
# run: |
# choco install openssl cmake
- name: Create Build directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE \
-DCN_CBOR_USE_CONTEXT=${{matrix.USE_CONTEXT}} \
-DCN_CBOR_BUILD_DOCS=OFF \
-DCN_CBOR_COVERALLS=OFF \
-DCN_CBOR_BUILD_TESTS=ON \
-DBUILD_SHARED_LIBS=OFF \
-DCN_CBOR_FATAL_WARNINGS=OFF \
${{matrix.CMAKE_OPTIONS}}
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build .
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
run: ctest -C Debug --verbose
clang-tidy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
USE_CONTEXT: ["ON", "OFF"]
CMAKE_OPTIONS:
[
"-DCN_CBOR_NO_FLOATS=ON",
"-DCN_CBOR_ALIGN_READS=ON",
"-DCN_CBOR_OPTIMIZE=ON"
]
steps:
- uses: actions/checkout@v1
- name: setup (linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt install cmake-data clang clang-tidy
- name: Create Build directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
export CC=clang && \
export CXX=clang++ && \
cmake $GITHUB_WORKSPACE \
-DCN_CBOR_USE_CONTEXT=${{matrix.USE_CONTEXT}} \
-DCN_CBOR_BUILD_DOCS=OFF \
-DCN_CBOR_BUILD_TESTS=ON \
-DCN_CBOR_RUN_CLANG_TIDY=ON \
${{matrix.CMAKE_OPTIONS}}
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build .