Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow #14

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7531700
Create go-format-check.yml
lvmingze123 Oct 12, 2024
c5109fe
Update go-format-check.yml
lvmingze123 Oct 12, 2024
e51c147
Update go-format-check.yml
lvmingze123 Oct 12, 2024
23f43b0
Update go-format-check.yml
lvmingze123 Oct 12, 2024
8962711
Update go-format-check.yml
lvmingze123 Oct 12, 2024
578c6a1
Update go-format-check.yml
lvmingze123 Oct 13, 2024
8f9ecde
Update go-format-check.yml
lvmingze123 Oct 13, 2024
3e254fc
Update go-format-check.yml
lvmingze123 Oct 13, 2024
4c65560
Update go-format-check.yml
lvmingze123 Oct 13, 2024
553584a
Update go-format-check.yml
lvmingze123 Oct 13, 2024
b70dab2
Update go-format-check.yml
lvmingze123 Oct 14, 2024
b242c5c
Create main.go
lvmingze123 Oct 14, 2024
3ac1b3d
Delete main.go
lvmingze123 Oct 21, 2024
e442118
Create workflow
lvmingze123 Oct 21, 2024
dfdecd2
Update workflow
lvmingze123 Oct 21, 2024
c07e246
Create commitlint
lvmingze123 Oct 21, 2024
c38a9e7
Update workflow
lvmingze123 Oct 21, 2024
39e8001
Create learn-github-actions.yml
lvmingze123 Oct 21, 2024
e1a78ac
Update workflow
lvmingze123 Oct 21, 2024
588e27e
Update workflow
lvmingze123 Oct 27, 2024
fb236ec
Update workflow
lvmingze123 Oct 28, 2024
417c2c7
Create golint.yml
lvmingze123 Oct 28, 2024
6e2f409
Update commitlint.yml
lvmingze123 Oct 28, 2024
8ccd2f1
Delete workflow
lvmingze123 Oct 28, 2024
5158989
Delete .github/workflows/golint.yml
lvmingze123 Oct 28, 2024
1e55b5a
Delete .github/workflows/commitlint.yml
lvmingze123 Oct 28, 2024
3021b06
Delete .github/workflows/go-format-check.yml
lvmingze123 Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create golint.yml
lvmingze123 authored Oct 28, 2024
commit 417c2c78565e64f721bcf3a55dd18576e829dee8
50 changes: 50 additions & 0 deletions .github/workflows/golint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Go Lint


on:

push:
branches: [ main ]

pull_request:
branches: [ '**' ]

# 定义工作流程
jobs:
golangci:
name: lint
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3


- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: true


- name: Install dependencies
run: go mod download


- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=5m


- name: Check code formatting
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Code is not properly formatted. Please run 'go fmt'"
gofmt -s -l .
exit 1
fi

- name: Run go vet
run: go vet ./...