Skip to content

Commit b26abde

Browse files
MartinNikovPetarKirov
authored andcommitted
feat(github): Add reusable Lint job
1 parent 0087a68 commit b26abde

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/lint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Lint
2+
3+
on:
4+
# Run this workflow when PRs target `main` and when they're merged in `main`:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
update-flake-lock:
11+
uses: ./.github/workflows/reusable-lint.yml
12+
secrets: inherit
13+
with:
14+
runner: '["self-hosted", "Linux", "x86-64-v2"]'
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 'Lint'
2+
3+
on:
4+
# Allow this workflow to be reused by other workflows:
5+
workflow_call:
6+
inputs:
7+
runner:
8+
description: 'JSON-encoded list of runner labels'
9+
default: '["self-hosted"]'
10+
required: false
11+
type: string
12+
13+
secrets:
14+
NIX_GITHUB_TOKEN:
15+
description: GitHub token to add as access-token in nix.conf
16+
required: false
17+
CACHIX_AUTH_TOKEN:
18+
description: 'Cachix auth token'
19+
required: true
20+
21+
jobs:
22+
lint:
23+
runs-on: self-hosted
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Install Nix
28+
uses: metacraft-labs/nixos-modules/.github/install-nix@main
29+
with:
30+
nix-github-token: ${{ secrets.NIX_GITHUB_TOKEN }}
31+
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
32+
cachix-cache: ${{ vars.CACHIX_CACHE }}
33+
trusted-public-keys: ${{ vars.TRUSTED_PUBLIC_KEYS }}
34+
substituters: ${{ vars.SUBSTITUTERS }}
35+
36+
- uses: cachix/cachix-action@v15
37+
with:
38+
name: ${{ vars.CACHIX_CACHE }}
39+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
40+
41+
- name: Build & activate the Nix Dev Shell
42+
run: |
43+
eval "$(nix print-dev-env --accept-flake-config --accept-flake-config --impure .#devShells.x86_64-linux.default || echo exit 1)"
44+
env >> "$GITHUB_ENV"
45+
46+
- name: Check formatting
47+
run: pre-commit run --all

0 commit comments

Comments
 (0)