add CI workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: ['**'] | |
| pull_request: | |
| branches: ['**'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up vcpkg | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg.git ${{ github.workspace }}/vcpkg | |
| ${{ github.workspace }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics | |
| echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" >> $GITHUB_ENV | |
| - name: Cache vcpkg packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ github.workspace }}/vcpkg/installed | |
| ~/.cache/vcpkg | |
| key: vcpkg-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }} | |
| restore-keys: vcpkg-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: | | |
| $VCPKG_ROOT/vcpkg install nlohmann-json openssl gtest slick-net | |
| - name: Configure | |
| run: | | |
| cmake -S . -B build \ | |
| -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: cmake --build build --config Release -j $(nproc) | |
| - name: Unit tests | |
| run: ctest --test-dir build -R hyperliquid_tests --output-on-failure | |
| - name: Integration tests | |
| run: ctest --test-dir build -R hyperliquid_integration_tests --output-on-failure | |
| timeout-minutes: 5 |