other workflow #192
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: code_testing | |
on: [ push ] | |
concurrency: | |
group: publish-conan-branch-package-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_and_run_tests_and_examples: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- os: ubuntu-22.04 | |
compiler: clang-17 | |
- os: ubuntu-22.04 | |
compiler: gcc-13 | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.compiler }}) | |
steps: | |
- name: Add repo for gcc-13 and clang-17 | |
run: | | |
# gcc-13 | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
# clang-17 | |
source /etc/os-release | |
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.gpg > /dev/null | |
- name: Install libstdc++-13 | |
run: | | |
sudo apt-get install libstdc++-13-dev -y | |
- name: Get minimum cmake version | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: 3.22.5 | |
- name: Install compiler | |
id: install_cc | |
uses: rlalik/[email protected] | |
with: | |
compiler: ${{ matrix.config.compiler }} | |
- name: install conan packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3-pip | |
pip3 install "conan==1.62.0" | |
conan profile new --detect default | |
conan profile update settings.compiler.libcxx=libstdc++11 default | |
- uses: actions/checkout@v3 | |
- name: build tests and examples | |
run: | | |
mkdir build | |
cd build | |
cmake -DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON -DWITH_BLAKE2=ON .. && make -j | |
env: | |
CC: ${{ steps.install_cc.outputs.cc }} | |
CXX: ${{ steps.install_cc.outputs.cxx }} | |
- name: run tests | |
run: | | |
for test in build/tests/*; do | |
./$test | |
done | |
- name: run examples | |
run: | | |
for example in build/examples/*; do | |
./$example | |
done |