Use custom tarpaulin Github action with taskwarrior
This commit is contained in:
22
.github/actions/cargo-tarpaulin-action/action.yml
vendored
Normal file
22
.github/actions/cargo-tarpaulin-action/action.yml
vendored
Normal 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
|
||||
15
.github/actions/cargo-tarpaulin-action/cargo-tarpaulin.sh
vendored
Executable file
15
.github/actions/cargo-tarpaulin-action/cargo-tarpaulin.sh
vendored
Executable 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
|
||||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user