From 0f2f85695521bb4fa39c965b2f08d781550bb5aa Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 13 Jan 2020 23:21:56 +0100 Subject: [PATCH] ci: initial github workflow --- .github/workflow/rust.yml | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflow/rust.yml diff --git a/.github/workflow/rust.yml b/.github/workflow/rust.yml new file mode 100644 index 00000000..4d972e08 --- /dev/null +++ b/.github/workflow/rust.yml @@ -0,0 +1,83 @@ +# Baseon on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md + +on: [push, pull_request] + +name: Continuous integration + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - name: Checkout + - uses: actions/checkout@v2 + + - name: Rust toolchain + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Check + - uses: actions-rs/cargo@v1 + with: + command: check + + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + - macOS-latest + steps: + - name: Checkout + - uses: actions/checkout@v2 + + - name: Rust toolchain + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Check + - uses: actions-rs/cargo@v1 + with: + command: test + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + 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 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: rustup component add clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings +