mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
ci: Don't run clippy & tests if rust files haven't changed
This commit is contained in:
@@ -9,6 +9,7 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fast-checks:
|
fast-checks:
|
||||||
@@ -40,10 +41,32 @@ jobs:
|
|||||||
cargo +nightly fmt --all -- --check && \
|
cargo +nightly fmt --all -- --check && \
|
||||||
echo "✅ Formatting check passed" || \
|
echo "✅ Formatting check passed" || \
|
||||||
exit 1
|
exit 1
|
||||||
|
check-changes:
|
||||||
|
name: Check changed files
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
rust: ${{ steps.filter.outputs.rust }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Check for file changes
|
||||||
|
uses: https://github.com/dorny/paths-filter@v4
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
rust:
|
||||||
|
- '**/*.rs'
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
|
||||||
clippy-and-tests:
|
clippy-and-tests:
|
||||||
name: Clippy and Cargo Tests
|
name: Clippy and Cargo Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: check-changes
|
||||||
|
if: needs.check-changes.outputs.rust == 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|||||||
Reference in New Issue
Block a user