chore: update ubuntu 20.04 to ubuntu-latest and actions/cache to v4 #3346
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: 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-latest, 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/cache@v4 | |
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 |