Skip to content

Commit ef20b23

Browse files
committed
add CI workflow
1 parent 8be94b2 commit ef20b23

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build-and-test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up vcpkg
21+
run: |
22+
git clone https://github.com/microsoft/vcpkg.git ${{ github.workspace }}/vcpkg
23+
${{ github.workspace }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
24+
echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" >> $GITHUB_ENV
25+
26+
- name: Cache vcpkg packages
27+
uses: actions/cache@v4
28+
with:
29+
path: |
30+
${{ github.workspace }}/vcpkg/installed
31+
~/.cache/vcpkg
32+
key: vcpkg-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }}
33+
restore-keys: vcpkg-${{ runner.os }}-
34+
35+
- name: Install dependencies
36+
run: |
37+
$VCPKG_ROOT/vcpkg install nlohmann-json openssl gtest slick-net
38+
39+
- name: Configure
40+
run: |
41+
cmake -S . -B build \
42+
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
43+
-DCMAKE_BUILD_TYPE=Release
44+
45+
- name: Build
46+
run: cmake --build build --config Release -j $(nproc)
47+
48+
- name: Unit tests
49+
run: ctest --test-dir build -R hyperliquid_tests --output-on-failure
50+
51+
- name: Integration tests
52+
run: ctest --test-dir build -R hyperliquid_integration_tests --output-on-failure
53+
timeout-minutes: 5

0 commit comments

Comments
 (0)