Skip to content

Commit a87e7db

Browse files
committed
feat: Update Github Actions and README
1 parent 0710c34 commit a87e7db

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

.github/workflows/go.yml

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ jobs:
8181
- name: Upload coverage to Codecov
8282
uses: codecov/codecov-action@v5
8383
if: success()
84+
with:
85+
token: ${{ secrets.CODECOV_TOKEN }}
8486

8587
analysis:
8688
name: Codacy Analysis

Makefile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.PHONY: test test_race test_with_mock test_ci_coverage format bench report_bench cpu_report mem_report build
2+
3+
COVER_OUT := coverage.out
4+
COVER_HTML := coverage.html
5+
6+
test: COVER_OPTS = -covermode count
7+
test_race: COVER_OPTS = -race -covermode atomic
8+
test_with_mock: COVER_OPTS = -race -gcflags=all=-l -covermode atomic
9+
10+
test test_race test_with_mock:
11+
go test -v $(COVER_OPTS) -coverprofile=$(COVER_OUT) && go tool cover -html=$(COVER_OUT) -o $(COVER_HTML) && go tool cover -func=$(COVER_OUT) -o $(COVER_OUT)
12+
13+
test_ci_coverage:
14+
go test -race -gcflags=all=-l -coverprofile=coverage.txt -covermode=atomic
15+
16+
format:
17+
go fmt .
18+
19+
bench:
20+
go test -bench . -benchmem -cpu 1
21+
22+
report_bench:
23+
go test -cpuprofile cpu.prof -memprofile mem.prof -bench . -cpu 1
24+
25+
cpu_report:
26+
go tool pprof cpu.prof
27+
28+
mem_report:
29+
go tool pprof mem.prof
30+
31+
build:
32+
go build -v ./...

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,25 @@
22

33
[![Go Reference](https://pkg.go.dev/badge/github.com/txaty/go-bigcomplex.svg)](https://pkg.go.dev/github.com/txaty/go-bigcomplex)
44
[![Go Report Card](https://goreportcard.com/badge/github.com/txaty/go-bigcomplex)](https://goreportcard.com/report/github.com/txaty/go-bigcomplex)
5-
![Coverage](https://img.shields.io/badge/Coverage-45.8%25-yellow)
5+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/3a9bb5ff5cb64dcf83903ca998a9144d)](https://app.codacy.com/gh/txaty/go-merkletree/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
6+
[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
67

78
Big complex number calculation library for Go (with [math/big](https://pkg.go.dev/math/big)).
89

910
Currently, the library supports:
1011

1112
1. Gaussian integer, complex numbers whose real and imaginary parts are both integers:
1213

13-
![gaussian_int](asset/image/gaussian_integer_formula.jpg)
14+
$$
15+
Z[i] = \{ a + bi \;|\; a, b \in \mathbb{Z} \}, \quad \text{where } i^2 = -1.
16+
$$
1417

1518
2. Hurwitz quaternion, quaternions whose components are either all integers or all half-integers (halves of odd
1619
integers; a mixture of integers and half-integers is excluded):
1720

18-
![hurwitz_int](asset/image/hurwitz_integer_formula.jpg)
21+
$$
22+
H = \{ a + bi + cj + dk \in \mathbb{H} \;|\; a, b, c, d \in \mathbb{Z} \; \text{or} \; b, c, d \in \mathbb{Z} + \frac{1}{2} \}.
23+
$$
1924

2025
## Installation
2126

-6.97 KB
Binary file not shown.
-8.76 KB
Binary file not shown.

0 commit comments

Comments
 (0)