Skip to content

Commit

Permalink
check Cargo.lock in the CI (#43)
Browse files Browse the repository at this point in the history
##
[changelog](https://github.com/amtoine/nu_plugin_explore/pull/43/commits)
- use the Makefile rules
- check the `Cargo.lock` file (see how the CI is failing because it's
not up to date)
- update `Cargo.lock` (see how the CI becomes green again)
  • Loading branch information
amtoine authored Apr 13, 2024
1 parent 84f525f commit bf44d75
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:

name: continuous-integration

env:
CLIPPY_OPTIONS: "-D warnings"

jobs:
fmt-check-clippy:
runs-on: ubuntu-20.04
Expand All @@ -21,17 +18,10 @@ jobs:
with:
rustflags: ""

- name: Format
run: cargo fmt --all -- --check

- name: Check the library
run: cargo check --workspace --lib

- name: Check the tests
run: cargo check --workspace --tests
- run: make check

- name: Clippy
run: cargo clippy --workspace -- $CLIPPY_OPTIONS
- name: Check Cargo.lock
run: make lock

tests:
strategy:
Expand All @@ -49,5 +39,4 @@ jobs:
with:
rustflags: ""

- name: Tests
run: cargo test --workspace
- run: make test
5 changes: 5 additions & 0 deletions .github/workflows/scripts/check-cargo-lock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

[[ -n "$(git status --short Cargo.lock)" ]] && exit 1

exit 0
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
CLIPPY_OPTIONS="-D warnings"

.PHONY: all check test fmt doc build register install clean
DEFAULT: check test
DEFAULT: check lock test

check:
cargo fmt --all --verbose -- --check --verbose
cargo check --workspace --lib --tests
cargo clippy --workspace -- "${CLIPPY_OPTIONS}"

lock: check
./.github/workflows/scripts/check-cargo-lock.sh

test: check
cargo test --workspace

Expand Down

0 comments on commit bf44d75

Please sign in to comment.