Bump tarpaulin version #1378
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: Code coverage | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize, ready_for_review] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
coverage: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- name: Checkout the source code | |
uses: actions/checkout@v3 | |
- name: Install & display rust toolchain | |
run: rustup show | |
- name: Check targets are installed correctly | |
run: rustup target list --installed | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Install deps | |
run: sudo apt -y install protobuf-compiler | |
- name: Install Tarpaulin v0.31.3 | |
run: | | |
curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.3/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz | |
tar -xvzf tarpaulin.tar.gz | |
chmod +x cargo-tarpaulin | |
sudo mv cargo-tarpaulin /usr/local/bin/ | |
- name: Run all tests & Generate report | |
run: | | |
cargo tarpaulin \ | |
--workspace \ | |
--features try-runtime,runtime-benchmarks \ | |
-e astar-collator xcm-tools local-runtime shibuya-runtime shiden-runtime astar-runtime integration-tests \ | |
--exclude-files vendor/* bin/* runtime/* tests/* **/mock.rs **/weights.rs \ | |
--out Xml | |
- name: Code Coverage Summary Report | |
uses: irongut/CodeCoverageSummary@v1.2.0 | |
with: | |
filename: cobertura.xml | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: '50 80' | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
recreate: true | |
path: code-coverage-results.md | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: cobertura.xml |