Skip to content

Plug interpolation

Plug interpolation #60

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: "-Cinstrument-coverage"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
default: true
toolchain: 1.65.0
components: llvm-tools-preview
- name: Quick check
run: |
cargo check
- name: Run tests
run: |
# we need stderr, but we can't run test twice because it'll regenerate/modify the binaries which interferes with `llvm-cov`
cargo test --all-features --no-fail-fast -- 2> >(tee stderr 1>&2)
# from https://stackoverflow.com/a/51141872/812178
sed -i 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' stderr
- name: Generate code coverage
run: |
find . -name '*.profraw' -exec $(rustc --print target-libdir)/../bin/llvm-profdata merge -sparse -o my.profdata {} +
sed -nE 's/ Running( unittests|) [^[:space:]]+ \(([^)]+)\)/\2/p' stderr | \
xargs printf ' --object %s' | \
xargs $(rustc --print target-libdir)/../bin/llvm-cov export \
--ignore-filename-regex='/.cargo/registry' \
--ignore-filename-regex='rustc' \
--instr-profile=my.profdata \
--skip-functions \
--format lcov > lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: rust