Skip to content

Commit 6cb99d3

Browse files
author
Josh Newman
committed
feat: add lint workflow
1 parent 570f71c commit 6cb99d3

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/lint.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
lint_proto:
5+
type: boolean
6+
default: false
7+
lint_go:
8+
type: boolean
9+
default: false
10+
11+
jobs:
12+
lint_proto:
13+
name: Lint Proto
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: bufbuild/buf-lint-action@v1
18+
with:
19+
input: api
20+
- uses: bufbuild/buf-breaking-action@v1
21+
with:
22+
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main,ref=HEAD~1"
23+
24+
lint_go:
25+
name: Lint Go
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v3
29+
- uses: actions/setup-go@v3
30+
if: ${{ inputs.lint_go }}
31+
with:
32+
go-version: 1.19
33+
check-latest: true
34+
cache: true
35+
- uses: golangci/golangci-lint-action@v3
36+
if: ${{ inputs.lint_go }}
37+
with:
38+
version: 1.50.1

.github/workflows/run-lint.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Lint
2+
3+
on:
4+
workflow_dispatch: { }
5+
6+
jobs:
7+
lint:
8+
uses: .github/workflows/lint.yaml
9+
with:
10+
lint_proto: true
11+
lint_go: true

0 commit comments

Comments
 (0)