generated from Warchant/cmake-hunter-seed
-
Notifications
You must be signed in to change notification settings - Fork 36
100 lines (96 loc) · 3.49 KB
/
ci.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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# 3 jobs in total
os: [ ubuntu-20.04, macOS-latest ]
compiler: [ {
"cc": "gcc",
"cxx": "g++"
}, {
"cc": "clang",
"cxx": "clang++"
} ]
exclude:
- os: macOS-latest
compiler:
cc: gcc
include:
- compiler:
cc: gcc
env:
COVERAGE: "-DCOVERAGE=ON"
- os: macOS-latest
env:
CFLAGS: "-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
CXXFLAGS: "-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
name: checkout repo
- name: cache
uses: actions/[email protected]
env:
cache-name: cache-filecoin-ffi-proofs
version: v28
with:
path: /var/tmp/filecoin-proof-parameters
key: build-${{ env.cache-name }}-${{ env.version }}
- name: install dependencies
run: |
set -e
if [ "$RUNNER_OS" = "macOS" ]; then
echo "LIBRARY_PATH=$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" >> $GITHUB_ENV
brew install ninja pkg-config libb2 hwloc hidapi coreutils
else
sudo apt-get update
sudo apt-get install -y ninja-build python-setuptools pkg-config ocl-icd-* opencl-headers libhwloc-dev libhidapi-dev
fi
pip3 -V || sudo python3 -m pip install --upgrade pip
sudo pip3 install scikit-build
sudo pip3 install requests gitpython gcovr pyyaml
sudo curl https://sh.rustup.rs -sSf | sh -s -- -y
# Workaround to provide additional free space for testing.
# https://github.com/actions/virtual-environments/issues/2875
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
- name: cmake
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
CFLAGS: ${{ matrix.env.CFLAGS }}
CXXFLAGS: ${{ matrix.env.CXXFLAGS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # has to be included to access other secrets
GITHUB_HUNTER_USERNAME: ${{ secrets.HUNTER_USERNAME }}
GITHUB_HUNTER_TOKEN: ${{ secrets.HUNTER_TOKEN }}
COVERAGE: ${{ matrix.env.COVERAGE }}
run: cmake . -GNinja -Bbuild $COVERAGE -D TESTING_PROOFS=ON -D TESTING_ACTORS=ON
- name: build
run: cmake --build build -- -j2
- name: tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: cmake --build build --target test
- name: prepare coverage report
if: runner.os == 'Linux' && matrix.compiler.cc == 'gcc'
run: cmake --build build --target ctest_coverage_norun
- name: upload report to codecov
if: runner.os == 'Linux' && matrix.compiler.cc == 'gcc'
uses: codecov/codecov-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # has to be included to access other secrets
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./build/ctest_coverage_norun.xml
name: codecov-umbrella