Merge branch 'main' of https://github.com/tw93/Pake
This commit is contained in:
51
.github/workflows/quality-and-test.yml
vendored
51
.github/workflows/quality-and-test.yml
vendored
@@ -16,9 +16,60 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
auto-format:
|
||||
name: Auto-fix Formatting
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref != 'refs/heads/main' && github.event_name != 'pull_request'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10.15.0
|
||||
run_install: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Setup Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Auto-fix Prettier formatting
|
||||
run: npx prettier --write . --ignore-unknown
|
||||
|
||||
- name: Auto-fix Rust formatting
|
||||
run: cargo fmt --all --manifest-path src-tauri/Cargo.toml
|
||||
|
||||
- name: Commit formatting fixes
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add .
|
||||
if ! git diff --staged --quiet; then
|
||||
git commit -m "🎨 Auto-fix formatting issues"
|
||||
git push
|
||||
else
|
||||
echo "No formatting changes to commit"
|
||||
fi
|
||||
|
||||
formatting:
|
||||
name: Code Formatting Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: auto-format
|
||||
if: always()
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
||||
Reference in New Issue
Block a user