nextcloud-spreed-signaling/.github/workflows/lint.yml

61 lines
1.6 KiB
YAML
Raw Normal View History

2020-07-31 14:14:34 +02:00
name: lint
on:
push:
branches: [ master ]
paths:
- '.github/workflows/lint.yml'
- '.golangci.yml'
- '**.go'
- 'go.*'
2020-07-31 14:14:34 +02:00
pull_request:
branches: [ master ]
paths:
- '.github/workflows/lint.yml'
- '.golangci.yml'
- '**.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:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
2023-03-06 09:52:24 +01:00
go-version: "1.20"
2022-04-05 10:32:03 +02:00
- id: go-cache-paths
run: |
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
uses: golangci/golangci-lint-action@v3.7.0
2020-07-31 14:14:34 +02:00
with:
version: latest
args: --timeout=2m0s