Skip to content

Commit cd925af

Browse files
committed
refactor: 任務依賴增加自定義超時時間和失敗策略 Skip 和 Stop,將全域 logger 轉移到實例中解決併發問題
1 parent 21a0b67 commit cd925af

File tree

12 files changed

+781
-311
lines changed

12 files changed

+781
-311
lines changed

.github/workflows/test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
go-version: [ '1.23' ]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
27+
- name: Cache Go modules
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.cache/go-build
32+
~/go/pkg/mod
33+
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
34+
restore-keys: |
35+
${{ runner.os }}-go-${{ matrix.go-version }}-
36+
37+
- name: Download dependencies
38+
run: go mod download
39+
40+
- name: Verify dependencies
41+
run: go mod verify
42+
43+
- name: Run tests
44+
run: go test -v -race -coverprofile=coverage.out ./...
45+
46+
- name: Run benchmarks
47+
run: go test -bench=. -benchmem ./...
48+
49+
- name: Check coverage
50+
run: go tool cover -html=coverage.out -o coverage.html
51+
52+
- name: Upload coverage reports
53+
uses: codecov/codecov-action@v4
54+
if: matrix.go-version == '1.23'
55+
with:
56+
file: ./coverage.out
57+
flags: unittests
58+
name: codecov-umbrella
59+
fail_ci_if_error: false

0 commit comments

Comments
 (0)