simplify dependency installation #3
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: C++ CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install C++ dependencies | |
| run: sudo apt update && sudo apt install -y build-essential cmake libgtest-dev # libbenchmark-dev | |
| # 2025-05-12: Added to resolve a linker error about the compiler and benchmark having different LTO versions. | |
| # Hopefully this can be removed in the future. | |
| - name: Build Google Benchmark from source | |
| run: | | |
| git clone https://github.com/google/benchmark.git | |
| cd benchmark | |
| git clone https://github.com/google/googletest.git | |
| cmake -B build -S . -DCMAKE_BUILD_TYPE=Release | |
| cmake --build build --target install | |
| - name: Setup | |
| run: cmake -B out -S . | |
| - name: Build | |
| run: cmake --build out/ | |
| - name: Unit Tests | |
| run: ./out/unit_tests |