forked from rollkit/rollkit
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (77 loc) · 2.19 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
# lint runs all linters in this repository
# This workflow is triggered by ci_release.yml workflow
name: lint
on:
workflow_call:
inputs:
go-version:
description: "Go version to use"
type: string
required: true
jobs:
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
# This steps sets the GIT_DIFF environment variable to true
# if files defined in PATTERS changed
- uses: technote-space/[email protected]
with:
# This job will pass without running if go.mod, go.sum, and *.go
# wasn't modified.
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: golangci/[email protected]
with:
version: latest
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: env.GIT_DIFF
# hadolint lints the Dockerfile
hadolint:
uses: rollkit/.github/.github/workflows/[email protected] # yamllint disable-line rule:line-length
with:
dockerfile: test/docker/mockserv.Dockerfile
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rollkit/.github/.github/actions/[email protected]
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rollkit/.github/.github/actions/[email protected]
protobuf-lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- run: make proto-gen
- run: make proto-lint
cli-docs-lint:
name: Lint CLI Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
- name: install rollkit cli
run: make install
- name: Generate Docs
run: rollkit docs-gen
- name: Verify no diff
run: |
DIFF=$(git diff)
if [[ -n "$DIFF" ]]; then
echo "$DIFF"
exit 1
fi