-
Notifications
You must be signed in to change notification settings - Fork 3
172 lines (146 loc) · 4.54 KB
/
Copy pathci.yml
File metadata and controls
172 lines (146 loc) · 4.54 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: ci
on:
push:
branches: [ main ]
tags:
- "v*"
pull_request:
branches: [ main ]
jobs:
cpplint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Build cpplint image
run: pip install "cpplint<2"
- name: Check code in /src
run: find src/ \( -name "*.cc" -o -name "*.h" \) -print0 | xargs -0 cpplint
- name: Check code in /tests
run: find tests/ \( -name "*.cc" -o -name "*.h" \) -print0 | xargs cpplint
- name: Check code in /examples
run: find examples/ \( -name "*.cc" -o -name "*.h" \) -print0 | xargs cpplint
build:
runs-on: ${{ matrix.os }}
needs: cpplint
strategy:
matrix:
os: [ ubuntu-24.04, windows-2022 ]
package_manager: [ "vcpkg", "conan" ]
exclude:
- os: windows-2022
package_manager: vcpkg
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build with vcpkg
if: matrix.package_manager == 'vcpkg'
uses: ./.github/actions/build-package-vcpkg
- name: Build with conan
if: matrix.package_manager == 'conan'
uses: ./.github/actions/build-package-conan
with:
build_tests: true
- name: Upload test artifacts
if: matrix.package_manager == 'conan'
uses: actions/upload-artifact@v4
with:
name: reduct-tests
path: build/Release/bin/reduct-tests
unit-tests:
needs:
- build
runs-on: ubuntu-24.04
strategy:
matrix:
token: [ "", "TOKEN" ]
reductstore_version: [ "main", "latest" ]
include:
- token: ""
exclude_token_api_tag: "~[token_api]"
- token: "TOKEN"
exclude_token_api_tag: ""
- reductstore_version: "main"
exclude_api_version_tag: ""
audit_enabled: "false"
- reductstore_version: "latest"
exclude_api_version_tag: "~[1_19]"
audit_enabled: "false"
steps:
- uses: actions/checkout@v4
- name: Download test artifacts
uses: actions/download-artifact@v5
with:
name: reduct-tests
path: build/Release/bin/
- name: Set execute permissions
run: chmod +x build/Release/bin/reduct-tests
- uses: ./.github/actions/run-tests
with:
api-token: ${{matrix.token}}
tags: "${{matrix.exclude_token_api_tag}} ${{matrix.exclude_api_version_tag}}"
reductstore-version: ${{matrix.reductstore_version}}
audit-enabled: ${{matrix.audit_enabled}}
check-example-linux:
needs: unit-tests
runs-on: ubuntu-24.04
strategy:
matrix:
dependency: [ system, fetchcontent ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install OpenSSL on Linux
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev
- name: Set use_fetchcontent
shell: bash
if: matrix.dependency == 'fetchcontent'
run: echo "USE_FETCHCONTENT=ON" >> $GITHUB_ENV
- name: Install package
if: matrix.dependency == 'system'
uses: ./.github/actions/build-package-system
- name: Build example
shell: bash
run: |
cd examples
cmake -S . -B build -DREDUCT_CPP_EXAMPLE_USE_FETCHCONTENT=${USE_FETCHCONTENT}
cmake --build build --config Release
check-example-windows:
runs-on: windows-2022
needs: unit-tests
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install OpenSSL on Windows
shell: bash
run: |
choco install openssl
- name: Build example
shell: bash
run: |
cd examples
cmake -S . -B build \
-DREDUCT_CPP_EXAMPLE_USE_FETCHCONTENT=ON\
-DOPENSSL_ROOT_DIR="C:/Program Files/OpenSSL"
cmake --build build ${BUILD_TAIL} --config Release
conan-test-package:
runs-on: ${{ matrix.os }}
needs: unit-tests
strategy:
matrix:
os: [ ubuntu-24.04, windows-2022 ]
steps:
- uses: actions/checkout@v4
- name: Create conan package
uses: ./.github/actions/install-conan
- name: Build package
shell: bash
run: conan create . --user=local --channel=test --build=missing -s build_type=Release
- name: Test package
shell: bash
run: conan test examples reduct-cpp/$(git describe --tags --always).local@local/test