-
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (65 loc) · 2.47 KB
/
Copy pathci.yml
File metadata and controls
76 lines (65 loc) · 2.47 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: ${{ matrix.os }} / ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Debug, Release]
env:
VCPKG_DIR: ${{ github.workspace }}/vcpkg
steps:
- uses: actions/checkout@v4
- name: Cache vcpkg
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: vcpkg-${{ runner.os }}-
- name: Bootstrap vcpkg (Linux)
if: runner.os == 'Linux'
run: |
if [ ! -f "${{ env.VCPKG_DIR }}/vcpkg" ]; then
git clone https://github.com/microsoft/vcpkg.git "${{ env.VCPKG_DIR }}"
"${{ env.VCPKG_DIR }}/bootstrap-vcpkg.sh" -disableMetrics
fi
"${{ env.VCPKG_DIR }}/vcpkg" install nlohmann-json openssl jwt-cpp
- name: Bootstrap vcpkg (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$vcpkgDir = "${{ env.VCPKG_DIR }}"
if (-not (Test-Path "$vcpkgDir\vcpkg.exe")) {
git clone https://github.com/microsoft/vcpkg.git $vcpkgDir
& "$vcpkgDir\bootstrap-vcpkg.bat" -disableMetrics
}
& "$vcpkgDir\vcpkg.exe" install nlohmann-json:x64-windows openssl:x64-windows jwt-cpp:x64-windows
- name: Configure (Linux)
if: runner.os == 'Linux'
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_DIR }}/scripts/buildsystems/vcpkg.cmake" \
-DBUILD_COINBASE_ADVANCED_TESTS=ON \
-DBUILD_COINBASE_ADVANCED_EXAMPLES=OFF
- name: Configure (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake -S . -B build `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
"-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DIR }}\scripts\buildsystems\vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DBUILD_COINBASE_ADVANCED_TESTS=ON `
-DBUILD_COINBASE_ADVANCED_EXAMPLES=OFF
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} -j 4
- name: Test
run: ctest --test-dir build -C ${{ matrix.build_type }} -E "(Order|Fill)" --output-on-failure