From 6beb077f25f686f058857dcda97f2c32cb7be223 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 18 Nov 2019 18:20:05 -0800 Subject: [PATCH] actions-rs configuration Uses GitHub Actions for CI, based on the `actions-rs` template: Configured to run tests on Linux (Ubuntu), macOS, and Windows, all of which we should theoretically be able to support via appropriately portable PC/SC Rust crates. --- .github/workflows/rust.yml | 122 +++++++++++++++++++++++++++++++++++++ README.md | 4 +- 2 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..4f65e12 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,122 @@ +# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md + +on: + pull_request: {} + push: + branches: master + +name: Rust + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + + test: + name: Test Suite + strategy: + matrix: + platform: + - ubuntu-latest + - macos-latest + # TODO: support Windows after eliminating C legacy + # - windows-latest + toolchain: + - 1.39.0 + - stable + runs-on: ${{ matrix.platform }} + steps: + - name: Checkout sources + uses: actions/checkout@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Install rustfmt + run: rustup component add rustfmt + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Install clippy + run: rustup component add clippy + + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + + # TODO: use actions-rs/audit-check + security_audit: + name: Security Audit + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Install cargo audit + run: cargo install cargo-audit + + - name: Run cargo audit + uses: actions-rs/cargo@v1 + with: + command: audit + args: --deny-warnings diff --git a/README.md b/README.md index bcb57ce..de389b7 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ USE AT YOUR OWN RISK! ## Requirements -- Rust 1.36+ +- Rust 1.39+ ## Code of Conduct @@ -111,7 +111,7 @@ or conditions. [docs-image]: https://docs.rs/yubikey-piv/badge.svg [docs-link]: https://docs.rs/yubikey-piv/ [license-image]: https://img.shields.io/badge/license-BSD-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.36+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.39+-blue.svg [maintenance-image]: https://img.shields.io/badge/maintenance-experimental-blue.svg [build-image]: https://github.com/tarcieri/yubikey-piv.rs/workflows/Rust/badge.svg [build-link]: https://github.com/tarcieri/yubikey-piv.rs/actions