Fix lint (#106)
This commit is contained in:
34
.github/workflows/ci.yaml
vendored
34
.github/workflows/ci.yaml
vendored
@@ -7,24 +7,14 @@ on:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.16"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v3.3.0"
|
||||
- uses: "actions/cache@v3"
|
||||
with:
|
||||
path: "~/go/pkg/mod"
|
||||
key: "${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}"
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gomod-
|
||||
|
||||
- uses: "actions/setup-go@v3"
|
||||
with:
|
||||
go-version: "${{ env.GO_VERSION }}"
|
||||
cache: true
|
||||
- run: "go build ./..."
|
||||
|
||||
generate:
|
||||
@@ -32,17 +22,10 @@ jobs:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v3.3.0"
|
||||
- uses: "actions/cache@v3"
|
||||
with:
|
||||
path: "~/go/pkg/mod"
|
||||
key: "${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}"
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gomod-
|
||||
|
||||
- uses: "actions/setup-go@v3"
|
||||
with:
|
||||
go-version: "${{ env.GO_VERSION }}"
|
||||
- run: "go install golang.org/x/tools/cmd/stringer"
|
||||
cache: true
|
||||
|
||||
- run: "go generate unifi/device.go"
|
||||
- run: "git diff --compact-summary --exit-code"
|
||||
@@ -51,14 +34,10 @@ jobs:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v3.3.0"
|
||||
- uses: "actions/cache@v3"
|
||||
with:
|
||||
path: "~/go/pkg/mod"
|
||||
key: "${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}"
|
||||
|
||||
- uses: "actions/setup-go@v3"
|
||||
with:
|
||||
go-version: "${{ env.GO_VERSION }}"
|
||||
cache: true
|
||||
- run: "go get ./..."
|
||||
- uses: "golangci/golangci-lint-action@v3"
|
||||
|
||||
@@ -67,12 +46,7 @@ jobs:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/checkout@v3.3.0"
|
||||
- uses: "actions/cache@v3"
|
||||
with:
|
||||
path: "~/go/pkg/mod"
|
||||
key: "${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}"
|
||||
|
||||
- uses: "actions/setup-go@v3"
|
||||
with:
|
||||
go-version: "${{ env.GO_VERSION }}"
|
||||
cache: true
|
||||
- run: "go test ./..."
|
||||
|
||||
11
.github/workflows/generate.yaml
vendored
11
.github/workflows/generate.yaml
vendored
@@ -4,24 +4,15 @@ on:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
GO_VERSION: "^1.16"
|
||||
|
||||
jobs:
|
||||
fields:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: "actions/setup-go@v3"
|
||||
with:
|
||||
go-version: "${{ env.GO_VERSION }}"
|
||||
cache: true
|
||||
|
||||
- uses: "actions/checkout@v3.3.0"
|
||||
- uses: "actions/cache@v3"
|
||||
with:
|
||||
path: "~/go/pkg/mod"
|
||||
key: "${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}"
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gomod-
|
||||
|
||||
# TODO: Automatically merge the PR if tests pass.
|
||||
- run: "go generate unifi/fields.go"
|
||||
|
||||
Reference in New Issue
Block a user