Skip to content

Commit c2a6031

Browse files
committed
CI: lint every commit in PR
Lint job now checks each commit in the PR individually.
1 parent 20620b2 commit c2a6031

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/rust.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,22 @@ jobs:
4343
steps:
4444
- name: "Checkout repo"
4545
uses: actions/checkout@v4
46+
with:
47+
# checkout full tree
48+
fetch-depth: 0
4649
- name: "Install nightly toolchain"
4750
uses: dtolnay/rust-toolchain@nightly
4851
- name: "Use cache"
4952
uses: Swatinem/rust-cache@v2
5053
- name: "Install clippy"
5154
run: rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
52-
- name: "Run code linting"
53-
run: bash contrib/lint.sh
55+
- name: "Run code linting on all commits"
56+
run: |
57+
for commit in $(git rev-list ${{ github.event.before }}..${{ github.sha }}); do
58+
git checkout $commit
59+
echo "checked out $commit"
60+
bash contrib/lint.sh
61+
done
5462
- name: "Run documentation linting"
5563
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --document-private-items
5664

0 commit comments

Comments
 (0)