Improve repo maintenance #7
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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Install code coverage dependencies | |
run: | | |
sudo apt update && | |
sudo apt install -y libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev | |
- name: Generate code coverage | |
run: | | |
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz | |
tar xzf master.tar.gz | |
cd kcov-master | |
mkdir build | |
cd build && cmake .. && make && make install DESTDIR=../../kcov-build | |
cd ../.. | |
rm -rf kcov-master | |
for file in target/debug/ogp-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done | |
bash <(curl -s https://codecov.io/bash) | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |