fix: Fail the CI if formatting fails
All checks were successful
CI / Format Check (push) Successful in 2s
CI / Flake Check (push) Successful in 1m40s
CI / Evaluate Key Configurations (nix-builder) (push) Successful in 15s
CI / Evaluate Key Configurations (nix-desktop1) (push) Successful in 8s
CI / Evaluate Key Configurations (nix-laptop1) (push) Successful in 9s
CI / Evaluate Artifacts (installer-iso-nix-laptop1) (push) Successful in 20s
CI / Evaluate Artifacts (lxc-nix-builder) (push) Successful in 13s
CI / Build and Publish Documentation (push) Successful in 11s
All checks were successful
CI / Format Check (push) Successful in 2s
CI / Flake Check (push) Successful in 1m40s
CI / Evaluate Key Configurations (nix-builder) (push) Successful in 15s
CI / Evaluate Key Configurations (nix-desktop1) (push) Successful in 8s
CI / Evaluate Key Configurations (nix-laptop1) (push) Successful in 9s
CI / Evaluate Artifacts (installer-iso-nix-laptop1) (push) Successful in 20s
CI / Evaluate Artifacts (lxc-nix-builder) (push) Successful in 13s
CI / Build and Publish Documentation (push) Successful in 11s
This commit is contained in:
@@ -26,18 +26,23 @@ jobs:
|
||||
format-check:
|
||||
name: Format Check
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check formatting
|
||||
timeout-minutes: 3
|
||||
run: |
|
||||
nix fmt **/*.nix
|
||||
if ! git diff --quiet; then
|
||||
set -euo pipefail
|
||||
echo "Checking code formatting..."
|
||||
output=$(nix fmt **/*.nix 2>&1)
|
||||
if [ -n "$output" ]; then
|
||||
echo "::error::Code is not formatted. Please run 'nix fmt **/*.nix' locally."
|
||||
git diff
|
||||
echo "$output"
|
||||
exit 1
|
||||
fi
|
||||
echo "All files are properly formatted"
|
||||
|
||||
eval-configs:
|
||||
name: Evaluate Key Configurations
|
||||
|
||||
Reference in New Issue
Block a user