change github action ubuntu version 18.04 -> latest #48
Workflow file for this run
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: CodeCov | |
on: [pull_request] | |
jobs: | |
ubuntu-llvm-code-cov: | |
runs-on: ubuntu-latest | |
env: | |
CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON" | |
strategy: | |
matrix: | |
build-type: ["Debug"] | |
clang-version: ["8"] | |
steps: | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
- name: C++ Setting | |
run: | | |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | |
sudo add-apt-repository -y "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-${{matrix.clang-version}} main" | |
sudo apt-get update | |
sudo apt-get install -yq clang-${{matrix.clang-version}} libc++-dev libc++abi-dev libstdc++-${{matrix.clang-version}}-dev build-essential cmake | |
sudo apt-get install -yq libllvm${{matrix.clang-version}} llvm-${{matrix.clang-version}} llvm-${{matrix.clang-version}}-dev llvm-${{matrix.clang-version}}-runtime | |
- name: Compiler Setting | |
run: | | |
echo "CC=clang-${{matrix.clang-version}}" >> $GITHUB_ENV | |
echo "CXX=clang++-${{matrix.clang-version}}" >> $GITHUB_ENV | |
- name: Clone Repository | |
uses: actions/checkout@master | |
with: | |
submodules: true | |
- name: CMake build | |
run: | | |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} . | |
cd build | |
cmake --build . --config ${{matrix.build-type}} | |
- name: Generate Coverage Report | |
run: | | |
cd build/${{matrix.build-type}} | |
./unittest | |
llvm-profdata-${{matrix.clang-version}} merge -sparse default.profraw -o default.profdata | |
llvm-cov-${{matrix.clang-version}} export ./unittest --instr-profile default.profdata -format=lcov >> lcov.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
directory: ./build/${{matrix.build-type}} | |
files: lcov.info | |
flags: unittest | |
fail_ci_if_error: true | |
verbose: true |