C++ CMake Test #49
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++ CMake Test | |
on: | |
# every day-of-month 1st at 00:00 UTC | |
schedule: | |
# prettier-ignore | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
check-links: | |
uses: ./.github/workflows/link-check.yml | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set variables | |
run: | | |
echo "BUILD_TYPE_LOWERCASE=$(echo ${BUILD_TYPE} | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_ENV} | |
- name: Install dependencies | |
run: | | |
sudo apt install -y ninja-build | |
- name: Setup vcpkg | |
working-directory: /usr/local/share/vcpkg | |
run: | | |
git fetch --all | |
git reset --hard origin/master | |
./bootstrap-vcpkg.sh | |
- name: Install packages | |
working-directory: /usr/local/bin | |
run: ./vcpkg install gsl:x64-linux gtest:x64-linux benchmark:x64-linux fmt:x64-linux | |
- name: Configure CMake | |
run: cmake --preset linux-${{env.BUILD_TYPE_LOWERCASE}} -S ${{github.workspace}}/cpp-algorithm -B ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-${{env.BUILD_TYPE_LOWERCASE}} | |
- name: Build | |
working-directory: ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-${{env.BUILD_TYPE_LOWERCASE}} | |
run: cmake --build . --config ${{env.BUILD_TYPE}} --target all --parallel 6 | |
- name: Test | |
working-directory: ${{github.workspace}}/cpp-algorithm/out/build/linux-x64-${{env.BUILD_TYPE_LOWERCASE}} | |
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure |