Skip to content

Commit e5378cc

Browse files
committed
Use Nix for all pre-commit dependencies instead of Python
1 parent 3ff2387 commit e5378cc

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

.github/workflows/pre-commit.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,23 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- name: Setup Python
18-
uses: actions/setup-python@v5
17+
- name: Install Nix
18+
uses: cachix/install-nix-action@v31
1919
with:
20-
python-version: '3.10'
20+
extra_nix_config: |
21+
experimental-features = nix-command flakes
2122
2223
- uses: actions/cache@v4
2324
with:
2425
path: ~/.cache/pre-commit
2526
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
2627

27-
- name: Install Nix
28-
uses: cachix/install-nix-action@v31
29-
with:
30-
extra_nix_config: |
31-
experimental-features = nix-command flakes
32-
33-
- name: Install Dependencies for Pre-commit Hooks
28+
- name: Install Dependencies with Nix
3429
run: |
35-
# Install Nix tools
36-
nix profile install nixpkgs#nixfmt-rfc-style nixpkgs#shellcheck
37-
38-
# Install pre-commit
39-
pip install pre-commit
30+
# Install all dependencies via Nix
31+
nix profile install nixpkgs#pre-commit nixpkgs#nixfmt-rfc-style nixpkgs#shellcheck
4032
4133
- name: Run pre-commit hooks
4234
run: |
43-
# Run pre-commit
44-
pre-commit run --all-files --hook-stage commit
35+
# Run pre-commit hooks
36+
pre-commit run --all-files

0 commit comments

Comments
 (0)