-
-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (76 loc) · 3.48 KB
/
Copy pathci.yml
File metadata and controls
89 lines (76 loc) · 3.48 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
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, macos-latest, windows-latest]
build_type: [Debug, Release]
env:
VCPKG_DIR: ${{ github.workspace }}/vcpkg
VCPKG_BINARY_CACHE: ${{ github.workspace }}/vcpkg-binary-cache
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg-binary-cache,readwrite"
steps:
- uses: actions/checkout@v4
# Cache the vcpkg clone + bootstrap binary separately from package binaries.
# Bump the suffix (v1, v2, ...) to force a fresh vcpkg update.
- name: Cache vcpkg tool
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg
key: vcpkg-tool-${{ runner.os }}-v1
- name: Cache vcpkg binary packages
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_BINARY_CACHE }}
key: vcpkg-binary-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml', '**/CMakeLists.txt') }}
restore-keys: vcpkg-binary-${{ runner.os }}-
- name: Prepare vcpkg binary cache directory
run: cmake -E make_directory "${{ env.VCPKG_BINARY_CACHE }}"
- name: Bootstrap vcpkg (Linux/macOS)
if: runner.os != 'Windows'
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 boost-asio boost-beast boost-context boost-system
- 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 boost-asio:x64-windows boost-beast:x64-windows boost-context:x64-windows boost-system:x64-windows
- name: Configure (Linux/macOS)
if: runner.os != 'Windows'
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|Portfolio|Account|Permissions|Balance|Margin|ListProducts|UserChannel|DataLogger|GetBestBidAsk|GetPriceBook|GetMarketTrades|GetProductCandles|CreateConvertQuote|ConcurrentOperations|GetProduct)" --output-on-failure