-
Notifications
You must be signed in to change notification settings - Fork 40
89 lines (73 loc) · 2.98 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Copyright 2023 Democratized Data Foundation
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.txt.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0, included in the file
# licenses/APL.txt.
name: Lint Workflow
on:
pull_request:
branches:
- master
- develop
push:
permissions:
# Required for the `only-new-issues` option.
pull-requests: read
# Required for analysis.
contents: read
# Required to annotate code in the PR.
checks: write
jobs:
lint-go:
name: Lint GoLang job
runs-on: ubuntu-latest
steps:
- name: Checkout code into the directory
uses: actions/checkout@v4
# Setting up Go explicitly is required for v3.0.0+ of golangci/golangci-lint-action.
- name: Setup Go environment explicitly
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: false
- name: Run golangci-lint linter
uses: golangci/golangci-lint-action@v6
with:
# Required: the version of golangci-lint is required.
# Note: The version should not pick the patch version as the latest patch
# version is what will always be used.
version: v1.54
# Optional: working directory, useful for monorepos or if we wanted to run this
# on a non-root directory.
# working-directory: ./
# Optional: golangci-lint command line arguments.
# Note: we can set `--issues-exit-code=0` if we want a successcode always,
# indicating that the linter ran successfully (weather or not linter errors
# exist or not doesn't matter). But the good thing is that the annotations
# will still show up. I think this can be useful if we don't want the pipeline
# to stop just because we had some linter errors.
args: --issues-exit-code=1 --config tools/configs/golangci.yaml
# Optional: we can set the below to `true` if we only want to see newly
# introduced linter errors, however I found that in practive that option is a
# bit gimmicky, as it passes the linter check despite having new linter errors
# in some cases. So we opt in for all annotations of linter errors to show up,
# this is actually nicer because we suppress our linter errors manually
# anyways so there shouldn't be any linter errors anyways. The enforces us to
# always have a clean lint state.
only-new-issues: false
lint-yaml:
name: Lint YAML job
runs-on: ubuntu-latest
steps:
- name: Checkout code into the directory
uses: actions/checkout@v4
- name: Run yamllint linter
uses: ibiqlik/action-yamllint@v3
with:
config_file: tools/configs/yamllint.yaml
file_or_dir: .