From 1fe47939e5cfa7c7865c2a73ed55951304087d06 Mon Sep 17 00:00:00 2001 From: pentamassiv <91755244+pentamassiv@users.noreply.github.com> Date: Sun, 22 Oct 2023 21:40:25 +0200 Subject: [PATCH] ci: Improve GitHub actions * CI: Simplify workflow, restrict permissions, test more extensively * CI: Added dependabot * Bump MSRV --- .github/dependabot.yml | 14 ++++++ .github/workflows/CI.yml | 100 ++++++++++++++------------------------- Cargo.toml | 2 +- README.md | 2 +- 4 files changed, 51 insertions(+), 67 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a1579d7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + # Maintain dependencies for cargo + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7eaea5c..48de3b7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,93 +18,63 @@ name: CI +permissions: + contents: read on: push: branches: - master pull_request: + workflow_dispatch: env: RUSTFLAGS: -Dwarnings - clippy_version: 1.60.0 + CARGO_TERM_COLOR: always jobs: - rustfmt: - name: rustfmt + CI: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - include: - - rust: stable + rust: + - stable + - beta + - nightly + - 1.58.1 steps: - uses: actions/checkout@v3 + with: + submodules: true - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - profile: minimal - override: true - components: rustfmt + components: rustfmt, clippy - uses: Swatinem/rust-cache@v1 - name: Run rustfmt + if: matrix.rust == 'stable' # Avoid differences between the versions run: cargo fmt --check - - clippy: - name: clippy - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.clippy_version }} - override: true - components: clippy - - uses: Swatinem/rust-cache@v1 - name: Run Clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all --tests --all-features - - test: - runs-on: ubuntu-latest - strategy: - matrix: - toolchain: - - stable - - beta - - nightly - - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - uses: Swatinem/rust-cache@v1 - - - name: Test + if: matrix.rust == 'stable' # Avoid differences between the versions + run: cargo clippy --all-features + - name: Check clippy lints for the examples + if: matrix.rust == 'stable' # Avoid differences between the versions + run: cargo clippy --all-features --examples + - name: Check clippy lints for the tests + if: matrix.rust == 'stable' # Avoid differences between the versions + run: cargo clippy --all-features --tests + - name: Build the crate + run: cargo build --all-features + - name: Build the examples + run: cargo build --all-features --examples + - name: Run the tests run: cargo test + - name: Run the tests with all features enabled + run: cargo test --all-features + - name: Build the docs + run: cargo doc + - name: Build the docs with all features enabled + run: cargo doc --all-features - msrv: - name: Build MSRV - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.48.0 - override: true - - uses: Swatinem/rust-cache@v1 - - name: Build - run: cargo build - - diff --git a/Cargo.toml b/Cargo.toml index ae5880f..3404e40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ description = "A library for working with X11 keysyms" repository = "https://github.com/notgull/xkeysym" license = "MIT OR Apache-2.0 OR Zlib" keywords = ["x11", "keysym", "keysyms"] -rust-version = "1.48.0" +rust-version = "1.58.1" [dev-dependencies] bytemuck = "1.12.3" diff --git a/README.md b/README.md index acecf9c..39d4689 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ In addition, this crate contains no unsafe code and is fully compatible with ## MSRV Policy -The Minimum Safe Rust Version for this crate is **1.48.0**. +The Minimum Safe Rust Version for this crate is **1.58.1**. ## License