Skip to content

Commit 436d7ae

Browse files
MartinNikovPetarKirov
authored andcommitted
feat(github): Add reusable Lint job
1 parent 61a2ea1 commit 436d7ae

File tree

3 files changed

+63
-39
lines changed

3 files changed

+63
-39
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,34 @@ on:
1111
pull_request:
1212
branches:
1313
- main
14-
push:
15-
branches:
16-
- main
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.repository }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
1718

1819
jobs:
20+
lint:
21+
uses: ./.github/workflows/reusable-lint.yml
22+
secrets: inherit
23+
with:
24+
runner: '["self-hosted", "Linux", "x86-64-v2"]'
25+
26+
test-mcl:
27+
runs-on: self-hosted
28+
steps:
29+
- name: Install Nix
30+
uses: metacraft-labs/nixos-modules/.github/install-nix@main
31+
with:
32+
cachix-cache: ${{ vars.CACHIX_CACHE }}
33+
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
34+
trusted-public-keys: ${{ vars.TRUSTED_PUBLIC_KEYS }}
35+
substituters: ${{ vars.SUBSTITUTERS }}
36+
37+
- uses: actions/checkout@v4
38+
39+
- name: Build and test the `mcl` command
40+
run: nix develop -c sh -c "dub test --root packages/mcl -- -e 'fetchJson|(coda\.)|nix.run|nix.build'"
41+
1942
ci:
2043
uses: ./.github/workflows/reusable-flake-checks-ci-matrix.yml
2144
secrets: inherit

.github/workflows/mcl.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
- name: Check formatting
37+
run: nix develop --accept-flake-config .#pre-commit -c pre-commit run --all --show-diff-on-failure --color=always

0 commit comments

Comments
 (0)