change installation instructions by using conan test
to do everything
#118
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 Test | |
on: [push] | |
jobs: | |
build_and_test: | |
name: Build & Test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
# - windows-latest | |
compiler: | |
- { name: llvm, version: 17.0.6 } | |
# - { name: gcc, version: 13, llvm: 17.0.6 } | |
build_type: | |
- Release | |
# - Debug | |
sanitizers: | |
- [] | |
# - ["address", "leak", "undefined_behavior"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate Cache Key | |
id: cache-key | |
uses: actions/github-script@v6 | |
env: | |
OS: ${{ matrix.os }} | |
COMPILER_NAME: ${{ matrix.compiler.name }} | |
COMPILER_VERSION: ${{ matrix.compiler.version }} | |
BUILD_TYPE: ${{ matrix.build_type }} | |
CONANFILE_HASH: ${{ hashFiles('conanfile.py') }} | |
SANITIZERS: ${{ join(matrix.sanitizers) }} | |
with: | |
result-encoding: string | |
script: | | |
const { OS, COMPILER_NAME, COMPILER_VERSION, BUILD_TYPE, CONANFILE_HASH, SANITIZERS } = process.env | |
let sanitizer_defs = SANITIZERS.split(",").reduce((result, sanitizer) => result + "-" + sanitizer, "") | |
if (sanitizer_defs.length !== 0) { | |
sanitizer_defs = "-" + sanitizer_defs | |
} | |
return `${OS}-${COMPILER_NAME}-${COMPILER_VERSION}-${BUILD_TYPE}-${CONANFILE_HASH}` + sanitizer_defs | |
- name: Generate CMake Sanitizer Definitions | |
id: cmake-sanitizer-defs | |
uses: actions/github-script@v6 | |
env: | |
SANITIZERS: ${{ join(matrix.sanitizers) }} | |
with: | |
result-encoding: string | |
script: | | |
const { SANITIZERS } = process.env | |
if (SANITIZERS.length === 0) { | |
return "" | |
} | |
function toCMakeDef(sanitizer) { | |
return "-DENABLE_SANITIZER_" + sanitizer.toUpperCase() + "=ON"; | |
} | |
return SANITIZERS.split(",").map(toCMakeDef).reduce((result, sanitizer) => result + " " + sanitizer, "") | |
- name: Cache Conan | |
uses: actions/cache@v3 | |
with: | |
path: ~/.conan/ | |
key: ${{steps.cache-key.outputs.result}} | |
- if: ${{ matrix.compiler.llvm }} | |
name: Setup LLVM for GCC | |
uses: aminya/setup-cpp@v1 | |
with: | |
llvm: ${{ matrix.compiler.llvm }} | |
- name: Setup Build Tools | |
uses: aminya/setup-cpp@v1 | |
with: | |
cmake: true | |
conan: 2.2.1 | |
ninja: true | |
compiler: ${{ matrix.compiler.name }}-${{ matrix.compiler.version }} | |
- name: Install numpy for boost | |
shell: bash | |
run: pip install numpy | |
- name: Detect default conan profile | |
shell: bash | |
run: conan profile detect | |
- name: Test | |
shell: bash | |
env: | |
SPDLOG_LEVEL: "trace" | |
run: conan test . ./conanfile.py --build missing -pr:h default -pr:b default -c tools.build:defines='["ENABLE_USER_LINKER=OFF"]' |