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 CI workflows #37

Merged
merged 5 commits into from
Jul 29, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Perform build of listenbrainz-rs
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run unit tests for listenbrain-rs
- name: Run tests
run: cargo test --verbose
17 changes: 17 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Format

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
name: Check formatting

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt --check --verbose
26 changes: 26 additions & 0 deletions .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Based on: https://github.com/foresterre/cargo-msrv/blob/main/.github/workflows/msrv.yml

name: MSRV
on:
push:
branches:
- main
pull_request:

jobs:
msrv:
name: Verify minimum supported Rust version

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-msrv
run: cargo install cargo-msrv --all-features
- name: Run cargo-msrv
run: cargo msrv --output-format json verify
- name: Run cargo-msrv on verification failure
if: ${{ failure() }}
run: cargo msrv --output-format json
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description = "ListenBrainz API bindings for Rust"
keywords = ["listenbrainz", "api", "bindings"]
categories = ["api-bindings"]
publish = true
rust-version = "1.58"
rust-version = "1.63.0"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason cargo-msrv on my machine claims the MSRV is 1.58, but the workflow claims 1.63.0. Not sure why this is happening.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is cargo-msrv up to date, as well as your Rsut toolchian? What does rustc -V report in the project dir?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. I updated Rust and cargo-msrv and ran it, and it spit out 1.58.1. However, for some reason now it's claiming 1.63.0, so I guess I may have had a stale build cache or something.


# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
Loading