fix typo #116
This file contains 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 and run Tests | |
on: [ push ] | |
concurrency: | |
group: build-and-run-tests-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-run-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- os: ubuntu-22.04 | |
compiler: clang-15 | |
- os: ubuntu-22.04 | |
compiler: clang-16 | |
- os: ubuntu-22.04 | |
compiler: clang-17 | |
- os: ubuntu-22.04 | |
compiler: gcc-12 | |
- os: ubuntu-22.04 | |
compiler: gcc-13 | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.compiler }}) | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Add repos for for gcc-13 and clang-16 | |
run: | | |
# gcc-13 | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
source /etc/os-release | |
# clang-16 | |
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-16 main" | sudo tee /etc/apt/sources.list.d/llvm-16.list | |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm-16.gpg > /dev/null | |
# clang-17 | |
echo "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-17 main" | sudo tee /etc/apt/sources.list.d/llvm-17.list | |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/llvm-17.gpg > /dev/null | |
sudo apt-get update -y | |
- name: Install CMake | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: 3.29.3 | |
- name: Install compiler | |
id: install_cc | |
uses: rlalik/[email protected] | |
with: | |
compiler: ${{ matrix.config.compiler }} | |
- name: Configure conan | |
run: | | |
pip3 install conan==2.3.0 | |
# conan profile update is deprecated (https://github.com/conan-io/conan/issues/13205) | |
# and they don't want you to use detect because it is unstable | |
conan profile detect # Force creation of conan directory structure, will be overwritten | |
echo '{% set compiler, version, c_exe = detect_api.detect_default_compiler() %}' > ~/.conan2/profiles/default | |
echo '[settings]' >> ~/.conan2/profiles/default | |
echo 'os={{ detect_api.detect_os() }}' >> ~/.conan2/profiles/default | |
echo 'arch={{ detect_api.detect_arch() }}' >> ~/.conan2/profiles/default | |
echo 'build_type=Release' >> ~/.conan2/profiles/default | |
echo 'compiler={{ compiler }}' >> ~/.conan2/profiles/default | |
echo 'compiler.version={{ detect_api.default_compiler_version(compiler, version) }}' >> ~/.conan2/profiles/default | |
echo 'compiler.libcxx=libstdc++11' >> ~/.conan2/profiles/default | |
conan remote add -f dice-group https://conan.dice-research.org/artifactory/api/conan/tentris | |
- name: Cache conan data | |
id: cache-conan | |
uses: actions/[email protected] | |
with: | |
path: ~/.conan2/p | |
key: ${{ matrix.config.os }}-${{ matrix.config.compiler }} | |
- uses: actions/[email protected] | |
- name: Get dependency provider | |
run: | | |
sudo apt-get install -y wget | |
wget https://github.com/conan-io/cmake-conan/raw/develop2/conan_provider.cmake -O conan_provider.cmake | |
- name: Configure CMake | |
run: cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -DBUILD_EXAMPLES=On -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -G Ninja -B build . | |
env: | |
CC: ${{ steps.install_cc.outputs.cc }} | |
CXX: ${{ steps.install_cc.outputs.cxx }} | |
- name: Build tests and examples | |
working-directory: build | |
run: cmake --build . --parallel 2 | |
- name: Run tests | |
working-directory: build | |
run: ctest --verbose --parallel 2 | |
- name: Run examples | |
working-directory: build | |
run: | | |
for example in examples/examples_*; do | |
echo "executing ${example}" | |
./${example} | |
done |