Skip to content

Commit

Permalink
chore: Dependabot fixes and tidying up (#131)
Browse files Browse the repository at this point in the history
I noticed that the Dependabot config is out of date and isn't working
right with the old format `rust-toolchain`.

I also took this opportunity to fix a broken link to releases in the
README

This configured dependabot to always add me as a reviewer. It also
switches from a weekly to a daily schedule.

I then got pulled into a yak-shaving exercise, ultimately updating several deps, updating to Rust 1.81, migrating to the `dtolnay/rust-toolchain` action, and updating `deny.toml` with some new licenses and some suppression of dupes.
  • Loading branch information
anelson authored Jan 9, 2025
1 parent 005416b commit 22322b9
Show file tree
Hide file tree
Showing 15 changed files with 1,137 additions and 893 deletions.
23 changes: 18 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
version: 2
updates:
- package-ecosystem: "cargo"
# Look for `Cargo.toml` and `Cargo.lock` in the root directory
directory: "/"
# Check for updates every Monday
schedule:
interval: "weekly"
interval: "daily"
open-pull-requests-limit: 10

# Add reviewer
reviewers:
- "anelson"

# Pull request settings
pull-request-branch-name:
separator: "-"

# Version update settings
versioning-strategy: "auto"

# Commit message settings
commit-message:
prefix: "chore"
include: "scope"
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates every Monday
schedule:
interval: "weekly"
interval: "daily"
open-pull-requests-limit: 10
111 changes: 48 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,61 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
arguments: --all-features
command: check advisories
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
arguments: --all-features
command: check advisories

# Do all possible static checks here
cargo-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
# The latest version of nightly leads to failre on CI check:
# error[E0635]: unknown feature `proc_macro_span_shrink`
# --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.58/src/lib.rs:92:30
# |
# 92 | feature(proc_macro_span, proc_macro_span_shrink)
# | ^^^^^^^^^^^^^^^^^^^^^^
#
# to prevent this we pinned the specific version of nightly with doesn't have this bug, you can unpin the version
# if you check that this works
#
# More details see here: https://github.com/dtolnay/proc-macro2/issues/356#issuecomment-1614449061
# and here https://github.com/dtolnay/proc-macro2/issues/356#issuecomment-1614467505
#
toolchain: nightly-2023-06-15
profile: minimal
override: true
- uses: Swatinem/rust-cache@v2
- uses: EmbarkStudios/cargo-deny-action@v1
with:
arguments: --all-features
command: check bans licenses sources
- name: Install cargo-udeps
shell: bash
run: |
wget \
--output-file cargo-udeps.tar.gz \
--tries=10 --retry-connrefused \
https://github.com/est31/cargo-udeps/releases/download/v0.1.35/cargo-udeps-v0.1.35-x86_64-unknown-linux-gnu.tar.gz
tar xvzf cargo-udeps-v0.1.35-x86_64-unknown-linux-gnu.tar.gz --strip-components=2
mv cargo-udeps $HOME/.cargo/bin/
- name: Check for unused dependencies
shell: bash
run: |
cargo +nightly-2023-06-15 udeps
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
# The latest version of nightly leads to failre on CI check:
# error[E0635]: unknown feature `proc_macro_span_shrink`
# --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.58/src/lib.rs:92:30
# |
# 92 | feature(proc_macro_span, proc_macro_span_shrink)
# | ^^^^^^^^^^^^^^^^^^^^^^
#
# to prevent this we pinned the specific version of nightly with doesn't have this bug, you can unpin the version
# if you check that this works
#
# More details see here: https://github.com/dtolnay/proc-macro2/issues/356#issuecomment-1614449061
# and here https://github.com/dtolnay/proc-macro2/issues/356#issuecomment-1614467505
#
toolchain: nightly-2023-06-15
- uses: Swatinem/rust-cache@v2
- uses: EmbarkStudios/cargo-deny-action@v1
with:
arguments: --all-features
command: check bans licenses sources
- name: Install cargo-udeps
shell: bash
run: |
wget \
--output-file cargo-udeps.tar.gz \
--tries=10 --retry-connrefused \
https://github.com/est31/cargo-udeps/releases/download/v0.1.35/cargo-udeps-v0.1.35-x86_64-unknown-linux-gnu.tar.gz
tar xvzf cargo-udeps-v0.1.35-x86_64-unknown-linux-gnu.tar.gz --strip-components=2
mv cargo-udeps $HOME/.cargo/bin/
- name: Check for unused dependencies
shell: bash
run: |
cargo +nightly-2023-06-15 udeps
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@1.81.0
with:
profile: minimal
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
Expand All @@ -87,10 +83,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@1.81.0
with:
profile: minimal
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy check
Expand All @@ -116,10 +110,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- name: Cache the minio binary
id: cache-minio
Expand Down Expand Up @@ -184,10 +175,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@1.81.0
with:
profile: minimal
target: x86_64-unknown-linux-musl
targets: x86_64-unknown-linux-musl
- name: Install MUSL deps
run: |
sudo apt-get install musl musl-dev musl-tools
Expand All @@ -198,7 +188,7 @@ jobs:
command: build
args: --release --target x86_64-unknown-linux-musl --package ssstar-cli
env:
RUSTFLAGS: '-C target-feature=+crt-static'
RUSTFLAGS: "-C target-feature=+crt-static"
- name: Test static binary
run: |
target/x86_64-unknown-linux-musl/release/ssstar --version
Expand All @@ -210,11 +200,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- name: Check documentation
env:
Expand All @@ -223,4 +209,3 @@ jobs:
with:
command: doc
args: --no-deps --document-private-items --all-features --workspace --examples

8 changes: 3 additions & 5 deletions .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish crates to crates.io
on:
push:
tags:
- '[v]?[0-9]+.[0-9]+.[0-9]+'
- "[v]?[0-9]+.[0-9]+.[0-9]+"

jobs:
publish-cargo:
Expand All @@ -17,10 +17,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
- name: Install Rust toolchain
uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v1
- name: Publish ssstar-testing
uses: actions-rs/cargo@v1
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ on:
workflow_dispatch:
push:
tags:
- '[v]?[0-9]+.[0-9]+.[0-9]+'
- "[v]?[0-9]+.[0-9]+.[0-9]+"

jobs:

publish-binaries:
name: Publishing for ${{ matrix.job.os }}
runs-on: ${{ matrix.job.os }}
Expand Down Expand Up @@ -45,10 +44,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@1.81.0
with:
profile: minimal
target: ${{ matrix.job.target }}
targets: ${{ matrix.job.target }}
- uses: Swatinem/rust-cache@v1
- name: Install Ubuntu MUSL deps
run: |
Expand All @@ -61,7 +59,7 @@ jobs:
use-cross: ${{ matrix.job.use-cross }}
args: --release --target ${{ matrix.job.target }} --package ssstar-cli
env:
RUSTFLAGS: '-C target-feature=+crt-static'
RUSTFLAGS: "-C target-feature=+crt-static"

- name: install strip command
shell: bash
Expand Down Expand Up @@ -110,7 +108,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/v')


publish-docker:
runs-on: ubuntu-latest
steps:
Expand Down
Loading

0 comments on commit 22322b9

Please sign in to comment.