Update Github CI configuration
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
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
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/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
|
||||
10
.github/workflows/audit.yml
vendored
10
.github/workflows/audit.yml
vendored
@@ -10,7 +10,15 @@ jobs:
|
||||
security_audit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/audit-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
118
.github/workflows/ci.yml
vendored
118
.github/workflows/ci.yml
vendored
@@ -1,57 +1,91 @@
|
||||
on: [push]
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
format:
|
||||
name: rustfmt
|
||||
test:
|
||||
name: Test Suite
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
components: rustfmt
|
||||
override: true
|
||||
- uses: LoliGothick/rustfmt-check@v0.2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
flags: --all
|
||||
options: --manifest-path=Cargo.toml
|
||||
|
||||
build_and_test:
|
||||
name: Build & test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
components: clippy
|
||||
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --release --all-features
|
||||
command: test
|
||||
args: --all-features --workspace
|
||||
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
rustfmt:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --tests -- -D warnings
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
components: rustfmt
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- name: Check formatting
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
clippy:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
components: clippy
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- name: Clippy check
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: --all-targets --all-features --workspace -- -D warnings
|
||||
|
||||
coverage:
|
||||
name: Code coverage
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- name: Run cargo-tarpaulin
|
||||
uses: ./.github/actions/cargo-tarpaulin-action/
|
||||
uses: actions-rs/tarpaulin@v0.1
|
||||
with:
|
||||
args: '-- --test-threads 1'
|
||||
|
||||
- name: Upload to codecov.io
|
||||
uses: codecov/codecov-action@v1.0.2
|
||||
args: '--all-features --workspace --ignore-tests --out Lcov'
|
||||
- name: Upload to Coveralls
|
||||
# upload only if push
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
uses: coverallsapp/github-action@master
|
||||
with:
|
||||
token: ${{secrets.CODECOV_TOKEN}}
|
||||
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: code-coverage-report
|
||||
path: cobertura.xml
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
path-to-lcov: './lcov.info'
|
||||
|
||||
Reference in New Issue
Block a user