1
1
mirror of https://github.com/cooperspencer/gickup synced 2024-10-19 02:08:06 +02:00
gickup/.github/workflows/validate-lint.yml
Andreas Wachter 041a5a88b7
handle multiple configs (#114)
* handle multiple configs

* upgrade golangci_lint_version

* SnakeCase and replaces ioutil with os
2022-10-03 19:20:19 +02:00

56 lines
1.2 KiB
YAML

name: Validate lint
on:
pull_request:
branches:
- '*'
env:
GO_VERSION: 1.17
GOLANGCI_LINT_VERSION: v1.48.0
jobs:
lint:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ${{ github.workspace }}/go/src/github.com/cooperspencer/gickup
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v2
with:
path: go/src/github.com/cooperspencer/gickup
fetch-depth: 0
- name: Cache Go modules
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-lint-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-lint-go
- name: Setup GOPATH
run: go env -w GOPATH=${{ github.workspace }}/go
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
working-directory: ${{ github.workspace }}/go/src/github.com/cooperspencer/gickup