File tree Expand file tree Collapse file tree 4 files changed +31
-4
lines changed
Expand file tree Collapse file tree 4 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 7676
7777 # https://doc.rust-lang.org/rustc/instrument-coverage.html
7878 - name : code coverage
79- run : |
80- cargo profdata -- merge -sparse default_*.profraw -o ptc_rust.profdata
81- cargo cov -- show -Xdemangler=rustfilt --use-color --ignore-filename-regex='/.cargo/registry' --instr-profile=ptc_rust.profdata $(find target/debug/examples/ -type f -executable | sed 's/^/--object /')
82- cargo cov -- export -Xdemangler=rustfilt --ignore-filename-regex='/.cargo/registry' --instr-profile=ptc_rust.profdata $(find target/debug/examples/ -type f -executable | sed 's/^/--object /') --summary-only | python .github/workflows/check_code_cov.py
79+ run : ./.github/workflows/code_cov.sh
80+
81+ shellcheck_shfmt :
82+ runs-on : ubuntu-latest
83+ steps :
84+ - uses : actions/checkout@v3
85+ - name : Install dependencies
86+ run : sudo apt install shfmt shellcheck
87+ - name : shellcheck and shfmt
88+ run : ./.github/workflows/shellcheck_shfmt.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ cargo clean
3+ rm -rf default_* .profraw ptc_rust.profdata .verify-helper/
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # RUSTFLAGS="-C instrument-coverage -C link-dead-code" oj-verify run --tle 20 --jobs 4 examples/data_structures/rmq.rs
3+
4+ set -eo pipefail
5+
6+ executables=$( find target/debug/examples/ -type f -executable | sed ' s/^/--object /' )
7+ cov_flags=(-Xdemangler=rustfilt --ignore-filename-regex=' /.cargo/registry' --instr-profile=ptc_rust.profdata " ${executables} " )
8+
9+ cargo profdata -- merge -sparse default_* .profraw -o ptc_rust.profdata
10+ # shellcheck disable=SC2068 # double quotes cause command to fail, not sure why
11+ cargo cov -- show ${cov_flags[@]} --use-color
12+ # shellcheck disable=SC2068
13+ cargo cov -- export ${cov_flags[@]} --summary-only | python .github/workflows/check_code_cov.py
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ shellcheck --shell=bash --check-sourced --enable=all .github/workflows/* .sh || exit 1
4+
5+ shfmt -ln=bash -s -d -w .github/workflows/* .sh || exit 1
You can’t perform that action at this time.
0 commit comments