Skip to content

Use conan to build the project (#5) #11

Use conan to build the project (#5)

Use conan to build the project (#5) #11

Workflow file for this run

name: Build and Test
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
jobs:
build-and-test:
runs-on: heavy
container: ghcr.io/xrplf/clio-ci:14342e087ceb8b593027198bf9ef06a43833c696
strategy:
matrix:
conan_profile: [gcc, clang]
build_type: [Release, Debug]
env:
BUILD_DIR: build
BUILD_TYPE: ${{ matrix.build_type }}
steps:
- name: Cleanup workspace
if: ${{ runner.os == 'macOS' }}
uses: XRPLF/actions/cleanup-workspace@cf0433aa74563aead044a1e395610c96d65a37cf
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@2cbf481018d930656e9276fcc20dc0e3a0be5b6d
with:
enable_ccache: false
- name: Run Conan
env:
CONAN_PROFILE: ${{ matrix.conan_profile }}
run: |
conan \
install . \
-of "${BUILD_DIR}" \
-b missing \
-s "build_type=${BUILD_TYPE}" \
-o "&:with_tests=True" \
--profile:all "${CONAN_PROFILE}"
- name: Run CMake
run: |
cmake \
-B "${BUILD_DIR}" \
-S . \
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
- name: Build
run: ninja
working-directory: ${{ env.BUILD_DIR }}
- name: Run tests
run: ctest --output-on-failure
working-directory: ${{ env.BUILD_DIR }}