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

Improvements to CI and the Justfile. #119

Merged
merged 5 commits into from
Mar 12, 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
20 changes: 20 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,27 @@ jobs:
rustup show

- uses: Swatinem/rust-cache@v2
with:
shared-key: "build" # share the cache across jobs

- name: build
run: |
cargo build --release --all-targets --all-features

# Sadly, `cargo build --locked` isn't enough to check that the lockfile
# is up to date, as it will happily run even if there are extra entries in
# there.
#
# It does, however, make sure that the file is not updated, which is quite
# unhelpful.
- name: ensure lockfile hasn't changed
run: |
if [[ -n "$(git status --porcelain Cargo.lock)" ]]; then
echo 'The Cargo.lock file was changed!'
git diff Cargo.lock
exit 1
fi

- name: clippy
run: |
cargo clippy --release --all-targets --all-features
22 changes: 22 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: format

on:
push:

jobs:
cargo-fmt:
name: check formatting with cargo fmt
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4

- name: install tools
run: |
rustup show

- name: check formatting
run: |
cargo fmt --all --check
43 changes: 0 additions & 43 deletions .github/workflows/lint.yaml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/machete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: find unused dependencies

on:
push:

jobs:
cargo-machete:
name: find unused dependencies with cargo machete
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4

- name: install tools
run: |
rustup show
cargo install cargo-machete

- uses: Swatinem/rust-cache@v2
with:
shared-key: "build" # share the cache across jobs
save-if: false

- name: find unused dependencies
run: |
cargo machete --with-metadata
5 changes: 4 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
rustup show

- uses: Swatinem/rust-cache@v2
with:
shared-key: "build" # share the cache across jobs
save-if: false

- name: run tests
run: cargo test
run: cargo test --release --all-targets --all-features
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# direnv
/.direnv

# testing
/tmp/empty
Loading
Loading