Skip to content

Lint

Lint #31

Workflow file for this run

name: Lint
on:
push:
branches: [ master ]
tags:
- v*
pull_request:
branches: [ master ]
jobs:
on-success:
needs: lint
runs-on: ubuntu-latest
if: ${{ always() && needs.lint.result == 'success' }}
steps:
- name: Notification Feishu
uses: whatwewant/[email protected]
with:
url: ${{ secrets.DOCKER_VERSION_FEISHU_BOT_WEBHOOK_URL }}
title: '✅ Lint 测试:${{ github.repository }}'
text: |
分支: ${{ github.ref }}
提交信息: ${{ github.event.head_commit.message }}
提交人: ${{ github.actor }}
状态: 构建成功(https://github.com/${{ github.repository }}/actions/runs/${{ github.run.id }})
on-failure:
needs: lint
runs-on: ubuntu-latest
if: ${{ always() && needs.lint.result == 'failure' }}
steps:
- name: Notification Feishu
uses: whatwewant/[email protected]
with:
url: ${{ secrets.DOCKER_VERSION_FEISHU_BOT_WEBHOOK_URL }}
title: '❌ Lint 测试:${{ github.repository }}'
text: |
分支: ${{ github.ref }}
提交信息: ${{ github.event.head_commit.message }}
提交人: ${{ github.actor }}
状态: 构建失败(https://github.com/${{ github.repository }}/actions/runs/${{ github.run.id }})
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22.1
- name: install deps
run: |
go mod tidy
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/lint/golint@latest
go install github.com/mattn/goveralls@latest
- name: static analysis
run: |
golint -set_exit_status
go vet
test -z "$(goimports -l .)"
- name: Test
run: goveralls -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}