build(orm): make standalone builds fetch vix core/db #36
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: build | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| compiler: [gcc, clang] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install tools + deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake ninja-build | |
| if [ "${{ matrix.compiler }}" = "gcc" ]; then | |
| sudo apt-get install -y gcc-12 g++-12 | |
| echo "CC=gcc-12" >> $GITHUB_ENV | |
| echo "CXX=g++-12" >> $GITHUB_ENV | |
| else | |
| sudo apt-get install -y clang | |
| echo "CC=clang" >> $GITHUB_ENV | |
| echo "CXX=clang++" >> $GITHUB_ENV | |
| fi | |
| sudo apt-get install -y libspdlog-dev libmysqlcppconn-dev | |
| - name: Cache CMake/FetchContent | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| build | |
| ~/.cache/cmake | |
| ~/.cache/CMake | |
| key: ${{ runner.os }}-${{ matrix.compiler }}-cmake-${{ hashFiles('CMakeLists.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.compiler }}-cmake- | |
| - name: Configure (Release) | |
| run: | | |
| cmake -S . -B build -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DVIX_ORM_FETCH_VIX_DEPS=ON \ | |
| -DVIX_ORM_BUILD_EXAMPLES=ON \ | |
| -DVIX_ORM_BUILD_TESTS=ON | |
| - name: Build | |
| run: cmake --build build -j | |
| - name: Run tests | |
| run: ctest --test-dir build --output-on-failure |