2020-07-31 14:14:34 +02:00
|
|
|
name: lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
2022-04-04 16:12:33 +02:00
|
|
|
paths:
|
2022-05-12 09:49:35 +02:00
|
|
|
- '.github/workflows/lint.yml'
|
2022-04-04 16:12:33 +02:00
|
|
|
- '**.go'
|
|
|
|
- 'go.*'
|
2020-07-31 14:14:34 +02:00
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
2022-04-04 16:12:33 +02:00
|
|
|
paths:
|
2022-05-12 09:49:35 +02:00
|
|
|
- '.github/workflows/lint.yml'
|
2022-04-04 16:12:33 +02:00
|
|
|
- '**.go'
|
|
|
|
- 'go.*'
|
2020-07-31 14:14:34 +02:00
|
|
|
|
2023-01-17 11:29:54 +01:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-07-31 14:14:34 +02:00
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
name: golang
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
2022-03-02 14:10:28 +01:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-08 22:11:32 +02:00
|
|
|
- uses: actions/setup-go@v3
|
2022-04-05 10:49:12 +02:00
|
|
|
with:
|
2023-03-06 09:52:24 +01:00
|
|
|
go-version: "1.20"
|
2022-04-05 10:49:12 +02:00
|
|
|
|
2022-04-05 10:32:03 +02:00
|
|
|
- id: go-cache-paths
|
|
|
|
run: |
|
2023-03-06 10:10:19 +01:00
|
|
|
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
|
|
|
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
|
|
|
echo "go-version=$(go version | cut -d ' ' -f 3)" >> $GITHUB_OUTPUT
|
2022-04-05 10:32:03 +02:00
|
|
|
|
|
|
|
- name: Go build cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ${{ steps.go-cache-paths.outputs.go-build }}
|
|
|
|
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-build-${{ hashFiles('**/go.mod', '**/go.sum') }}
|
|
|
|
|
|
|
|
- name: Go mod cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ${{ steps.go-cache-paths.outputs.go-mod }}
|
|
|
|
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-mod-${{ hashFiles('**/go.mod', '**/go.sum') }}
|
2020-07-31 14:14:34 +02:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2022-06-21 16:04:40 +02:00
|
|
|
sudo apt -y update && sudo apt -y install protobuf-compiler
|
2020-07-31 14:14:34 +02:00
|
|
|
make common
|
|
|
|
|
|
|
|
- name: lint
|
2023-01-23 21:03:58 +01:00
|
|
|
uses: golangci/golangci-lint-action@v3.4.0
|
2020-07-31 14:14:34 +02:00
|
|
|
with:
|
2022-02-11 10:32:23 +01:00
|
|
|
version: latest
|
2023-03-06 09:56:59 +01:00
|
|
|
args: --timeout=2m0s
|