Skip to content

Merge pull request #5 from Lenivaya/optimizations #9

Merge pull request #5 from Lenivaya/optimizations

Merge pull request #5 from Lenivaya/optimizations #9

Workflow file for this run

name: Format and Lint
on:
push:
branches:
- main
tags-ignore: ["v[0-9]+.[0-9]+.[0-9]+*"]
paths:
- "**.ts"
- "**.tsx"
- "**.js"
- "**.mjs"
- "**.cs"
- "**.rs"
- "Cargo*"
- ".github/workflows/**.yml"
jobs:
format-and-lint:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v14
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- uses: rrbutani/use-nix-shell-action@v1
with:
devShell: .#ci-format
- name: Format project source code
run: nix fmt
- name: Run Clippy
run: nix develop .#ci-format --command cargo clippy --all-features -- -D warnings
- name: Commit formatting changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply formatting changes
status_options: "--untracked-files=no"