Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr committed Sep 17, 2022
1 parent 9f132fc commit fe26cce
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
branch: false
ignore-not-existing: true
llvm: true
filter: covered
output-type: lcov
ignore:
- "*.cargo/*"
excl-start: "grcov-excl-start"
excl-stop: "grcov-excl-stop"
excl-line: "grcov-excl-line|#\\[derive\\("
72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build
on:
pull_request:
push:
branches:
- master

jobs:
test:
name: Test Suite
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true

- uses: Swatinem/rust-cache@v1

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --release

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: true

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Run rustdoc lints
uses: actions-rs/cargo@v1
env:
RUSTDOCFLAGS: "-D missing_docs -D rustdoc::missing_doc_code_examples"
with:
command: doc
args: --workspace --all-features --no-deps --document-private-items
36 changes: 36 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Code Coverage
on:
pull_request:
push:
branches:
- master

jobs:
code-coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Run tests with code coverage information
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
- name: Run grcov
id: coverage
uses: rraval/grcov@master
- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ steps.coverage.outputs.report }}

0 comments on commit fe26cce

Please sign in to comment.