From 60ae8c5e60ec3ad5098dc5369cc2755df4a2b255 Mon Sep 17 00:00:00 2001 From: Lucas <24826124+Luro02@users.noreply.github.com> Date: Sat, 21 Sep 2019 13:10:55 +0200 Subject: [PATCH] Update rust.yml --- .github/workflows/rust.yml | 84 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) 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..269b5ab --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,84 @@ +name: Rust + +# Trigger the workflow on push or pull request +on: [push, pull_request] + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust: + - stable + os: + - ubuntu-latest + # execute cargo build + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + - uses: actions-rs/cargo@v1 + with: + command: build + arguments: --all-features + + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust: + - stable + os: + - ubuntu-latest + # execute cargo test + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + + rustfmt: + name: Rustfmt + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + - run: rustup component add clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings