Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c6ec81664
|
||
|
|
899a70a189
|
||
|
|
a8dd84045e
|
||
|
|
a4f9f4894a
|
||
|
|
f890c89f1c
|
||
|
|
0dbe24e7d9
|
||
|
|
d974f1b7ac
|
@@ -0,0 +1,54 @@
|
|||||||
|
name: Code Quality (Auto-Format & Clippy-Fix)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
fix:
|
||||||
|
name: Formatierung & Clippy automatisch beheben
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
ref: ${{ gitea.ref_name || github.ref_name }}
|
||||||
|
token: ${{ secrets.PACKAGE_TOKEN || secrets.RELEASE_TOKEN || secrets.PUBLISH_TOKEN || secrets.API_TOKEN || secrets.PAT_TOKEN || secrets.CUSTOM_TOKEN || secrets.GITEA_TOKEN || secrets.GITHUB_TOKEN || github.token }}
|
||||||
|
|
||||||
|
- name: Install Rust Toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v2
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
components: clippy, rustfmt
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Cache Cargo-Abhängigkeiten & Build-Artefakte
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Formatierung automatisch beheben
|
||||||
|
run: cargo fmt
|
||||||
|
|
||||||
|
- name: Clippy-Fixes automatisch anwenden
|
||||||
|
run: cargo clippy --fix --allow-dirty --allow-staged --all-targets
|
||||||
|
|
||||||
|
- name: Änderungen committen & pushen
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
git config user.name "Gitea-Bot"
|
||||||
|
git config user.email "no-reply@creativedragonslayer.de"
|
||||||
|
git add -A
|
||||||
|
git commit -m "Style: Automatische Formatierung & Clippy-Fixes"
|
||||||
|
git push origin HEAD:${{ gitea.ref_name || github.ref_name }}
|
||||||
|
else
|
||||||
|
echo "Keine Formatierungs- oder Clippy-Änderungen."
|
||||||
|
fi
|
||||||
Generated
+3
@@ -29,6 +29,9 @@
|
|||||||
<Item>
|
<Item>
|
||||||
<option name="path" value=".gitea/workflows/unit-tests.yaml" />
|
<option name="path" value=".gitea/workflows/unit-tests.yaml" />
|
||||||
</Item>
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<option name="path" value=".gitea/workflows/code-quality.yaml" />
|
||||||
|
</Item>
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</SchemaInfo>
|
</SchemaInfo>
|
||||||
|
|||||||
Reference in New Issue
Block a user