Compare commits
2 Commits
308fea39fc
...
a70f151615
| Author | SHA1 | Date | |
|---|---|---|---|
| a70f151615 | |||
| 04c1b6b0d2 |
@@ -22,15 +22,22 @@ jobs:
|
|||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
cache: true
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Cache golangci-lint
|
||||||
run: go mod download
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /usr/local/bin/golangci-lint
|
||||||
|
key: golangci-lint-${{ env.GOLANGCI_LINT_VERSION }}
|
||||||
|
|
||||||
|
- name: Install golangci-lint
|
||||||
|
run: |
|
||||||
|
if [ ! -f /usr/local/bin/golangci-lint ]; then
|
||||||
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin ${{ env.GOLANGCI_LINT_VERSION }}
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Run golangci-lint
|
- name: Run golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v4
|
run: golangci-lint run --timeout=5m --issues-exit-code=0
|
||||||
with:
|
|
||||||
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
|
||||||
args: --timeout=5m --issues-exit-code=0
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
@@ -43,13 +50,10 @@ jobs:
|
|||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
cache: true
|
||||||
- name: Download dependencies
|
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
# 跳过无测试文件的情况
|
|
||||||
test_files=$(find . -name "*_test.go" -type f)
|
test_files=$(find . -name "*_test.go" -type f)
|
||||||
if [ -z "$test_files" ]; then
|
if [ -z "$test_files" ]; then
|
||||||
echo "No test files found, skipping tests"
|
echo "No test files found, skipping tests"
|
||||||
@@ -76,9 +80,7 @@ jobs:
|
|||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
cache: true
|
||||||
- name: Download dependencies
|
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
- name: Build binary
|
- name: Build binary
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// TODO: 实现启动逻辑
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user