Skip to content

Fix sources for local conanfile.py to use local files #725

Fix sources for local conanfile.py to use local files

Fix sources for local conanfile.py to use local files #725

Workflow file for this run

name: Check c++ pkg PROPOSAL.
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os : "ubuntu-latest"
compiler : "gcc"
compilerpp : "g++"
- os : "macos-latest"
compiler : "clang"
compilerpp : "clang++"
- os : "ubuntu-20.04"
compiler : "gcc-7"
compilerpp : "g++-7"
- os : "ubuntu-20.04"
compiler : "gcc-5"
compilerpp : "g++-5"
- os : "windows-latest"
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compilerpp }}
steps:
- uses: actions/checkout@v2
- name: Set up gcc5
if : ${{ matrix.compiler == 'gcc-5' }}
run: |
mkdir ~/Downloads
cd ~/Downloads
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/gcc-5-base_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/i/isl-0.18/libisl15_0.18-4_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/cpp-5_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/libasan2_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/libmpx0_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/libgcc-5-dev_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/gcc-5_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/libstdc++-5-dev_5.5.0-12ubuntu1_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5/g++-5_5.5.0-12ubuntu1_amd64.deb
sudo apt install ./g++-5_5.5.0-12ubuntu1_amd64.deb ./gcc-5_5.5.0-12ubuntu1_amd64.deb ./gcc-5-base_5.5.0-12ubuntu1_amd64.deb ./cpp-5_5.5.0-12ubuntu1_amd64.deb ./libisl15_0.18-4_amd64.deb ./libgcc-5-dev_5.5.0-12ubuntu1_amd64.deb ./libasan2_5.5.0-12ubuntu1_amd64.deb ./libmpx0_5.5.0-12ubuntu1_amd64.deb ./libstdc++-5-dev_5.5.0-12ubuntu1_amd64.deb
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
- name: Set up gcc7
if : ${{ matrix.compiler == 'gcc-7' }}
uses: egor-tensin/setup-gcc@v1
with:
version: 7
platform: x64
- name: Cache Conan
if: ${{ matrix.os != 'windows-latest' }}
id: cache-conan
uses: actions/cache@v2
with:
path: ~/.conan
key: ${{ runner.os }}-cache-conan-${{ matrix.compiler }}-${{ hashFiles('conanfile.py') }}-key
- name: Cache build
id: cache-build
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-cache-build-${{ matrix.compiler }}-${{ github.sha }}-key
- name: Cache tests
id: cache-tests
uses: actions/cache@v2
with:
path: tests
key: ${{ runner.os }}-cache-tests-${{ matrix.compiler }}-${{ github.sha }}-key
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install python dependencies
run: python -m pip install conan
- name: Initialize conan
run: conan profile detect
- name: Prepare dependencies using conan
if : ${{ matrix.compiler != 'gcc-5' }}
run: conan install . --build=missing -o with_testing=True
- name: Prepare dependencies using conan (gcc5)
if : ${{ matrix.compiler == 'gcc-5' }}
run: conan install . --build=missing -o with_testing=True -s:b compiler.cppstd=gnu14 -s compiler.cppstd=gnu14
- name: Call CMake
if: ${{ matrix.os != 'windows-latest' }}
run: cmake . -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake
- name: Call CMake (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: cmake . -DCMAKE_TOOLCHAIN_FILE="build/conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
- name: Build PROPOSAL
if: ${{ matrix.os != 'windows-latest' }}
run: cmake --build . -j2
- name: Build PROPOSAL (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: cmake --build . -j2 --config Release
test:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
include:
- os : "ubuntu-latest"
compiler : "gcc"
compilerpp : "g++"
- os : "macos-latest"
compiler : "clang"
compilerpp : "clang++"
- os : "ubuntu-20.04"
compiler : "gcc-7"
compilerpp : "g++-7"
- os : "ubuntu-20.04"
compiler : "gcc-5"
compilerpp : "g++-5"
- os : "windows-latest"
env:
PROPOSAL_TEST_FILES: ${{ github.workspace }}/tests/TestFiles
steps:
- uses: actions/checkout@v2
- name: Cache conan
if: ${{ matrix.os != 'windows-latest' }}
id: cache-conan
uses: actions/cache@v2
with:
path: ~/.conan
key: ${{ runner.os }}-cache-conan-${{ matrix.compiler }}-${{ hashFiles('conanfile.py') }}-key
- name: Cache tests
id: cache-tests
uses: actions/cache@v2
with:
path: tests
key: ${{ runner.os }}-cache-tests-${{ matrix.compiler }}-${{ github.sha }}-key
- name: Run tests
run: ctest --test-dir tests -j2 --verbose -E "(Brems.*Interpolant|Photo.*Interpolant|Epair.*Interpolant|Mupair.*Interpolant)"