Skip to content

Commit

Permalink
Revert "Validate Cargo.lock" and add validate-cargo-lock.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
laruh committed Dec 28, 2024
1 parent 15919ad commit 4d83f94
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/fmt-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Build cache
uses: ./.github/actions/build-cache

- name: Backup Cargo.lock
run: cp Cargo.lock Cargo.lock.bak

- name: fmt check
# Format checks aren't OS dependant.
if: matrix.os == 'ubuntu-latest'
Expand All @@ -40,14 +37,6 @@ jobs:
- name: clippy lint
run: cargo clippy --all-targets --all-features -- --D warnings

- name: Validate Cargo.lock
run: |
if ! diff Cargo.lock Cargo.lock.bak; then
echo "Error: Cargo.lock has changed during the workflow. Ensure Cargo.lock is up-to-date and committed."
exit 1
fi
shell: bash

wasm-lint:
name: Wasm Lint Checks
timeout-minutes: 45
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/validate-cargo-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Validate Cargo.lock
on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
validate-cargo-lock:
name: Validate Cargo.lock Consistency
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Rust toolchain
run: |
rustup toolchain install nightly-2023-06-01 --no-self-update --profile=minimal
rustup default nightly-2023-06-01
- name: Validate Cargo.lock
run: |
echo "Checking if Cargo.lock is up-to-date..."
cargo update -w --locked

0 comments on commit 4d83f94

Please sign in to comment.