totp-rs/.github/workflows/rust.yml

55 lines
1.2 KiB
YAML

name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --all-features
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: All features
run: cargo test --all-features
- name: No feature
run: cargo test
- name: otpauth feature
run: cargo test --features=otpauth
- name: gen_secret feature
run: cargo test --features=gen_secret
- name: otpauth+gensecret feature
run: cargo test --features=gen_secret,otpauth
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: '0.20.1'
args: --all-features --out=Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml