-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config(*.nix): Configure pre-commit to be used in the repo
- Loading branch information
1 parent
c77b04e
commit 1b90df5
Showing
4 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: "Lint" | ||
|
||
on: | ||
# Allow this workflow to be reused by other workflows: | ||
workflow_call: | ||
inputs: | ||
runner: | ||
description: 'JSON-encoded list of runner labels' | ||
default: '["self-hosted"]' | ||
required: false | ||
type: string | ||
|
||
secrets: | ||
NIX_GITHUB_TOKEN: | ||
description: GitHub token to add as access-token in nix.conf | ||
required: false | ||
CACHIX_AUTH_TOKEN: | ||
description: 'Cachix auth token' | ||
required: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: metacraft-labs/nixos-modules/.github/install-nix@main | ||
with: | ||
nix-github-token: ${{ secrets.NIX_GITHUB_TOKEN }} | ||
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
cachix-cache: ${{ vars.CACHIX_CACHE }} | ||
trusted-public-keys: ${{ vars.TRUSTED_PUBLIC_KEYS }} | ||
substituters: ${{ vars.SUBSTITUTERS }} | ||
|
||
- uses: cachix/cachix-action@v15 | ||
with: | ||
name: ${{ vars.CACHIX_CACHE }} | ||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
|
||
- name: Build & activate the Nix Dev Shell | ||
run: | | ||
eval "$(nix print-dev-env --accept-flake-config --accept-flake-config --impure .#devShells.x86_64-linux.default || echo exit 1)" | ||
env >> "$GITHUB_ENV" | ||
- name: Check formatting | ||
run: pre-commit run --all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ matrix-*.json | |
shardMatrix.json | ||
|
||
.vscode | ||
|
||
# Pre Commit | ||
.pre-commit-config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters