-
Notifications
You must be signed in to change notification settings - Fork 21
139 lines (137 loc) · 6.2 KB
/
cpp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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)"