Skip to content

Commit 6b695d3

Browse files
committed
Add test workflow
1 parent 38fe685 commit 6b695d3

File tree

2 files changed

+71
-16
lines changed

2 files changed

+71
-16
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
strategy:
15+
matrix:
16+
go-version: ['1.24', '1.25', 'stable']
17+
os: [ubuntu-latest]
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
27+
- name: Vet
28+
run: go vet ./...
29+
30+
- name: Test
31+
run: go test -race -count=1 -coverprofile=coverage.out ./...
32+
33+
- name: Upload coverage
34+
if: matrix.go-version == 'stable'
35+
uses: codecov/codecov-action@v4
36+
with:
37+
files: coverage.out
38+
env:
39+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
40+
41+
benchmark:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-go@v5
46+
with:
47+
go-version: stable
48+
- name: Benchmark
49+
run: go test -bench=. -benchmem -count=1 -run=^$ ./...

.gitignore

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
1-
# If you prefer the allow list template instead of the deny list, see community template:
2-
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3-
#
4-
# Binaries for programs and plugins
1+
# Binaries
52
*.exe
63
*.exe~
74
*.dll
85
*.so
96
*.dylib
107

11-
# Test binary, built with `go test -c`
8+
# Test artifacts
129
*.test
13-
14-
# Code coverage profiles and other test artifacts
1510
*.out
1611
coverage.*
1712
*.coverprofile
1813
profile.cov
14+
coverage.html
1915

20-
# Dependency directories (remove the comment below to include it)
21-
# vendor/
22-
23-
# Go workspace file
16+
# Go workspace
2417
go.work
2518
go.work.sum
2619

27-
# env file
20+
# Dependency directories
21+
vendor/
22+
23+
# Environment
2824
.env
25+
.env.*
26+
27+
# IDE / Editor
28+
.idea/
29+
.vscode/
30+
*.swp
31+
*.swo
32+
*~
33+
34+
# Cursor
35+
.cursor/
2936

30-
# Editor/IDE
31-
# .idea/
32-
# .vscode/
33-
.DS_STORE
37+
# OS files
38+
.DS_Store
39+
Thumbs.db

0 commit comments

Comments
 (0)