Use custom tarpaulin Github action with taskwarrior

This commit is contained in:
2022-01-10 21:43:03 +01:00
parent 2c737083c3
commit 835db054cf
6 changed files with 92 additions and 33 deletions

View File

@@ -0,0 +1,22 @@
name: 'cargo tarpaulin'
description: 'Gather Rust code coverage information with Tarpaulin'
inputs:
version:
description: 'The version of cargo-tarpaulin to install'
required: true
default: '0.19.0'
args:
required: false
description: 'Extra command line arguments passed to cargo-tarpaulin'
out-type:
description: 'Output format of coverage report [possible values: Json, Toml, Stdout, Xml, Html, Lcov]'
required: false
default: 'Xml'
runs:
using: 'composite'
steps:
- run: ${{ github.action_path }}/cargo-tarpaulin.sh ${{ inputs.out-type }} ${{ inputs.version }} ${{ inputs.args }}
shell: bash

View File

@@ -0,0 +1,15 @@
#!/bin/bash
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends openssl taskwarrior
out_type="$1"
version="$2"
args="$3"
tar_file="cargo-tarpaulin-${version}-travis.tar.gz"
wget "https://github.com/xd009642/tarpaulin/releases/download/${version}/${tar_file}"
tar zxvf "$tar_file"
chmod +x cargo-tarpaulin
exec env RUST_LOG=debug ./cargo-tarpaulin tarpaulin --ignore-tests -o "$out_type" $args

View File

@@ -20,7 +20,7 @@ jobs:
options: --manifest-path=Cargo.toml
build_and_test:
name: contextswitch-api
name: Build & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@@ -41,9 +41,8 @@ jobs:
args: -- -D warnings
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
uses: ./.github/actions/cargo-tarpaulin-action/
with:
version: '0.15.0'
args: '-- --test-threads 1'
- name: Upload to codecov.io