diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..8fc20681 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,43 @@ +name: Check + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: clippy + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + + - name: Clippy + run: cargo clippy --all + + rustfmt: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: rustfmt + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + + - name: Rustfmt + run: cargo fmt --all -- --check diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml index 37039061..51d2cad2 100644 --- a/.github/workflows/no-response.yml +++ b/.github/workflows/no-response.yml @@ -7,7 +7,7 @@ on: - cron: "10 * * * *" jobs: - noResponse: + no-response: runs-on: ubuntu-latest permissions: issues: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ffb8501..167b3218 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,6 @@ jobs: release: permissions: contents: write - strategy: matrix: include: @@ -25,14 +24,14 @@ jobs: target: x86_64-pc-windows-msvc - os: windows-latest target: aarch64-pc-windows-msvc - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install stable toolchain - run: rustup toolchain install stable --profile minimal + - name: Setup Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable - name: Add aarch64 target if: contains(fromJson('["aarch64-unknown-linux-gnu", "aarch64-apple-darwin", "aarch64-pc-windows-msvc"]'), matrix.target) @@ -44,7 +43,7 @@ jobs: sudo apt-get update sudo apt-get install -yq gcc-aarch64-linux-gnu - - name: Cache dependencies + - name: Setup Rust cache uses: Swatinem/rust-cache@v2 - name: Build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4aa09fe4..a86141ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,9 @@ name: Test on: push: - branches: ["main"] + branches: [main] pull_request: - branches: ["main"] + branches: [main] env: CARGO_TERM_COLOR: always @@ -14,20 +14,20 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Install stable toolchain - run: rustup toolchain install stable --profile minimal + - name: Setup Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable - - name: Cache dependencies + - name: Setup Rust cache uses: Swatinem/rust-cache@v2 - name: Build run: cargo build --verbose - - name: Run tests + - name: Test run: cargo test --verbose