Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve GitHub actions #21

Merged
merged 3 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
100 changes: 35 additions & 65 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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


2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading