-
Notifications
You must be signed in to change notification settings - Fork 351
48 lines (45 loc) · 1.43 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Lint
on:
pull_request:
merge_group:
push:
branches:
- master
- release/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
golangci:
name: golangci-lint
runs-on: macos-latest
timeout-minutes: 120
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.22.7'
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
with:
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
**/*.go
*.mod
*.sum
- name: golangci-lint
run: |
nix profile install -f ./nix golangci-lint
nix profile install -f ./nix rocksdb
export PKG_CONFIG_PATH=$HOME/.nix-profile/lib/pkgconfig
export CGO_CFLAGS="$(pkg-config --cflags rocksdb)" CGO_LDFLAGS="$(pkg-config --libs rocksdb)"
golangci-lint version
BUILD_TAGS=rocksdb,grocksdb_clean_link
go build -tags $BUILD_TAGS ./cmd/chain-maind
golangci-lint run --out-format=github-actions --path-prefix=./ --timeout 30m --build-tags $BUILD_TAGS
# Check only if there are differences in the source code
if: steps.changed-files.outputs.any_changed == 'true'