Skip to content

Commit 986ac78

Browse files
committed
ci: improved ci
1 parent ad7c922 commit 986ac78

File tree

3 files changed

+71
-20
lines changed

3 files changed

+71
-20
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: "**"
6+
pull_request:
7+
branches: "**"
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
strategy:
13+
matrix:
14+
go-version: [1.21.x, 1.22.x]
15+
os: [ubuntu-latest]
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: ${{ matrix.go-version }}
24+
# - name: Set up Make
25+
# run: sudo apt-get install make
26+
- name: Run tests
27+
#run: make test
28+
run: go test ./...
29+
golangci:
30+
name: lint
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-go@v5
35+
with:
36+
go-version: 1.22.x
37+
- name: golangci-lint
38+
uses: golangci/golangci-lint-action@v4
39+
with:
40+
version: latest

.github/workflows/test.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/testCoverage.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
jobs:
9+
coverage:
10+
strategy:
11+
matrix:
12+
go-version: [1.21.x, 1.22.x]
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Install Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
24+
- name: Test
25+
run: go test -race -covermode=atomic -coverprofile="profile.cov" ./...
26+
27+
- name: Send Coverage
28+
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.22.x'
29+
uses: shogo82148/actions-goveralls@v1
30+
with:
31+
path-to-profile: profile.cov

0 commit comments

Comments
 (0)