From efd3f850b12e1a9db934ed9d45120380a0908784 Mon Sep 17 00:00:00 2001 From: MedzikUser Date: Sat, 11 Jun 2022 13:08:27 +0200 Subject: [PATCH] ci: add rust github action --- .github/workflows/rust.yml | 76 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 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..d10e26a --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,76 @@ +name: Rust + +on: + push: + branches: + - main + + pull_request: + + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + rust: [stable, nightly] + + name: ${{ matrix.rust }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Rust toolchain + id: rust-toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: clippy + + - name: cargo build + uses: actions-rs/cargo@v1 + with: + command: build + args: --all-features + + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --no-deps -- -D warnings + + test: + strategy: + fail-fast: false + matrix: + rust: [stable, nightly] + + name: ${{ matrix.rust }} test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Rust toolchain + id: rust-toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features