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:
|
format-check:
|
||||||
name: Format Check
|
name: Format Check
|
||||||
runs-on: [self-hosted, nix-builder]
|
runs-on: [self-hosted, nix-builder]
|
||||||
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
|
timeout-minutes: 3
|
||||||
run: |
|
run: |
|
||||||
nix fmt **/*.nix
|
set -euo pipefail
|
||||||
if ! git diff --quiet; then
|
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."
|
echo "::error::Code is not formatted. Please run 'nix fmt **/*.nix' locally."
|
||||||
git diff
|
echo "$output"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "All files are properly formatted"
|
||||||
|
|
||||||
eval-configs:
|
eval-configs:
|
||||||
name: Evaluate Key Configurations
|
name: Evaluate Key Configurations
|
||||||
|
|||||||
Reference in New Issue
Block a user