Skip to content

Commit f0febee

Browse files
committed
ci
1 parent 9a647d2 commit f0febee

File tree

2 files changed

+54
-39
lines changed

2 files changed

+54
-39
lines changed

.circleci/config.yml

+20-22
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
version: 2
22
jobs:
3-
go1.21: &base
3+
go1.22: &base
44
docker:
5-
- image: cimg/go:1.21
5+
- image: cimg/go:1.22
66
steps:
77
- run: go version
88
- checkout
9-
- run: go test -tags nikandfor_loc_unsafe -race -v ./...
9+
- run: go test -tags nikandfor_loc_unsafe -v ./...
10+
- run: go test -tags nikandfor_loc_unsafe -v -race ./...
11+
12+
go1.21:
13+
<<: *base
14+
docker:
15+
- image: cimg/go:1.21
1016

1117
go1.20:
1218
<<: *base
@@ -28,28 +34,21 @@ jobs:
2834
docker:
2935
- image: cimg/go:1.17
3036

31-
go1.16:
32-
<<: *base
33-
docker:
34-
- image: circleci/golang:1.16
35-
working_directory: /go/wd
36-
37-
go1.15:
38-
<<: *base
39-
docker:
40-
- image: circleci/golang:1.15
4137

42-
go1.14:
38+
go1.22_safe: &base_safe
4339
<<: *base
4440
docker:
45-
- image: circleci/golang:1.14
46-
47-
go1.21_safe: &base_safe
48-
<<: *base
41+
- image: cimg/go:1.22
4942
steps:
5043
- run: go version
5144
- checkout
52-
- run: go test -race -v ./...
45+
- run: go test -v -race ./...
46+
- run: go test -v ./...
47+
48+
go1.21_safe:
49+
<<: *base_safe
50+
docker:
51+
- image: cimg/go:1.21
5352

5453
go1.20_safe:
5554
<<: *base_safe
@@ -70,15 +69,14 @@ workflows:
7069
version: 2
7170
build:
7271
jobs:
72+
- go1.22_safe
7373
- go1.21_safe
7474
- go1.20_safe
7575
- go1.19_safe
7676
- go1.18_safe
77+
- go1.22
7778
- go1.21
7879
- go1.20
7980
- go1.19
8081
- go1.18
8182
- go1.17
82-
#- go1.16 test passes in official docker image (arm64), but not in circleci
83-
- go1.15
84-
- go1.14

.github/workflows/go.yml

+34-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a golang project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3-
41
name: Go
52

63
on:
@@ -10,22 +7,42 @@ on:
107
branches: [ "master" ]
118

129
jobs:
13-
14-
build:
15-
runs-on: ubuntu-latest
10+
test:
11+
strategy:
12+
matrix:
13+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
14+
go-ver: ["1.22", "1.21", "1.20", "1.19"]
15+
include:
16+
- os: "ubuntu-latest"
17+
go-ver: "1.22"
18+
cover: true
19+
20+
runs-on: ${{ matrix.os }}
1621
steps:
17-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v3
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v4
26+
with:
27+
go-version: ${{ matrix.go-ver }}
28+
29+
- name: Build
30+
run: go build -v ./...
31+
32+
- name: Test with Cover
33+
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
34+
if: ${{ matrix.cover }}
1835

19-
- name: Set up Go
20-
uses: actions/setup-go@v3
21-
with:
22-
go-version: "1.21"
36+
- name: Test without Cover
37+
run: go test -v ./...
38+
if: ${{ !matrix.cover }}
2339

24-
- name: Build
25-
run: go build -v ./...
40+
- name: Test Race
41+
run: go test -race -v ./...
2642

27-
- name: Test
28-
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
43+
- name: Upload coverage reports to Codecov
44+
uses: codecov/codecov-action@v4
45+
if: ${{ matrix.cover }}
46+
env:
47+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2948

30-
- name: Upload coverage reports to Codecov
31-
uses: codecov/codecov-action@v3

0 commit comments

Comments
 (0)