From 40b60eb096acaf425395ec12cbc481db6e344a72 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 23 May 2024 05:03:08 +1000 Subject: [PATCH] ci: update GitHub Actions script --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 18 ----------------- 2 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..976f666 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +name: Rust + +on: [push, workflow_dispatch, pull_request] + +jobs: + check: + env: + RUSTFLAGS: "-D warnings" + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + + - name: Checks + run: | + cargo fmt --check + cargo clippy --all-targets + + test-msrv: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@1.70 + + - name: Build with MSRV + run: cargo build --all-features diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index d167421..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Rust - -on: [push, workflow_dispatch, pull_request] - -jobs: - build: - - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-11] - - steps: - - uses: actions/checkout@v1 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose