-
Notifications
You must be signed in to change notification settings - Fork 7
79 lines (59 loc) · 2.32 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
on:
push:
branches: [main]
pull_request:
branches: [main]
name: decimal
jobs:
test:
strategy:
matrix:
go-version: [oldstable, stable]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Check out code
uses: actions/checkout@v3
- name: Verify code formatting
run: gofmt -s -w . && git diff --exit-code
- name: Verify dependency consistency
run: go mod tidy && git diff --exit-code
- name: Verify generated code
run: go generate ./... && git diff --exit-code
- name: Verify potential issues
uses: golangci/golangci-lint-action@v3
- name: Run tests with coverage
run: go test -race -shuffle=on -coverprofile="coverage.txt" -covermode=atomic ./...
- name: Upload test coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
fuzz:
needs: test
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: stable
- name: Check out code
uses: actions/checkout@v3
- name: Run fuzzing for string conversion
run: go test -fuzztime 20s -fuzz ^FuzzDecimal_String_StringVsParse$ github.com/govalues/decimal
- name: Run fuzzing for float64 conversion
run: go test -fuzztime 20s -fuzz ^FuzzDecimal_Float64_Float64VsNew$ github.com/govalues/decimal
- name: Run fuzzing for int64 conversion
run: go test -fuzztime 20s -fuzz ^FuzzDecimal_Int64_Int64VsNew$ github.com/govalues/decimal
- name: Run fuzzing for addition
run: go test -fuzztime 20s -fuzz ^FuzzDecimal_Add_FintVsSint$ github.com/govalues/decimal
- name: Run fuzzing for multiplication
run: go test -fuzztime 20s -fuzz ^FuzzDecimal_Mul_FintVsSint$ github.com/govalues/decimal
- name: Run fuzzing for fused multiply-addidtion
run: go test -fuzztime 40s -fuzz ^FuzzDecimal_FMA_FintVsSint$ github.com/govalues/decimal
- name: Run fuzzing for division
run: go test -fuzztime 20s -fuzz ^FuzzDecimal_Quo_FintVsSint$ github.com/govalues/decimal
- name: Run fuzzing for comparison
run: go test -fuzztime 20s -fuzz ^FuzzDecimal_Cmp_FintVsSint$ github.com/govalues/decimal