From 8f5fa81f12cd9be85bfd65ce98f8972497f27cf5 Mon Sep 17 00:00:00 2001 From: Dominik Nakamura Date: Sat, 9 Apr 2022 11:08:40 +0900 Subject: [PATCH] Improve CI setup --- .github/workflows/ci.yml | 45 +++++++++++++--------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 760c92d..b38b0e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: [pull_request, push] env: CARGO_INCREMENTAL: 0 + CARGO_TERM_COLOR: always RUSTFLAGS: "-C debuginfo=0 -D warnings" jobs: check: @@ -11,22 +12,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Setup Rust - uses: actions-rs/toolchain@v1 + uses: taiki-e/github-actions/install-rust@main with: toolchain: stable - override: true - name: Configure cache uses: Swatinem/rust-cache@v1 - name: Install cargo-hack - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-hack + run: cargo install cargo-hack - name: Check feature combinations - uses: actions-rs/cargo@v1 - with: - command: hack - args: clippy --feature-powerset --no-dev-deps + run: cargo hack clippy --feature-powerset --no-dev-deps test: name: Test runs-on: ${{ matrix.os }} @@ -38,17 +32,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Setup Rust - uses: actions-rs/toolchain@v1 + uses: taiki-e/github-actions/install-rust@main with: - profile: minimal toolchain: ${{ matrix.toolchain }} - override: true - name: Configure cache uses: Swatinem/rust-cache@v1 - name: Test - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test lint: name: Lint runs-on: ubuntu-latest @@ -56,28 +46,21 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Setup Rust (nightly) - uses: actions-rs/toolchain@v1 + uses: taiki-e/github-actions/install-rust@main with: toolchain: nightly - override: true - components: rustfmt + component: rustfmt - name: Run rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + run: cargo fmt -- --check - name: Setup Rust (stable) - uses: actions-rs/toolchain@v1 + uses: taiki-e/github-actions/install-rust@main with: toolchain: stable - override: true + component: clippy - name: Configure cache uses: Swatinem/rust-cache@v1 - name: Run clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-features -- -D warnings + run: cargo clippy -- -D warnings cargo-deny: name: Cargo Deny runs-on: ubuntu-latest @@ -91,6 +74,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - name: Check ${{ matrix.checks }} - uses: EmbarkStudios/cargo-deny-action@v1 + uses: dnaka91/actions/deny-check@main with: - command: check ${{ matrix.checks }} + checks: ${{ matrix.checks }}