Skip to content

Commit e82c700

Browse files
committed
GHA workflows for unit tests
1 parent 834d13d commit e82c700

File tree

5 files changed

+58
-47
lines changed

5 files changed

+58
-47
lines changed

.github/workflows/go-retryablehttp.yml

-46
This file was deleted.

.github/workflows/pr-gofmt.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Go format check
2+
on:
3+
pull_request:
4+
types: ['opened', 'synchronize']
5+
6+
jobs:
7+
run-tests:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
11+
12+
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
13+
with:
14+
go-version-file: ./.go-version
15+
16+
- name: Run go format
17+
run: |-
18+
files=$(gofmt -s -l .)
19+
if [ -n "$files" ]; then
20+
echo >&2 "The following file(s) are not gofmt compliant:"
21+
echo >&2 "$files"
22+
exit 1
23+
fi
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Unit tests (Go 1.19)
2+
on:
3+
pull_request:
4+
types: ['opened', 'synchronize']
5+
6+
jobs:
7+
run-tests:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
11+
12+
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
13+
with:
14+
go-version: 1.19
15+
16+
- name: Run unit tests
17+
run: make test
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Unit tests (Go 1.20+)
2+
on:
3+
pull_request:
4+
types: ['opened', 'synchronize']
5+
6+
jobs:
7+
run-tests:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
11+
12+
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
13+
with:
14+
go-version: 1.22
15+
16+
- name: Run unit tests
17+
run: make test

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ default: test
22

33
test:
44
go vet ./...
5-
go test -race ./...
5+
go test -v -race ./...
66

77
updatedeps:
88
go get -f -t -u ./...

0 commit comments

Comments
 (0)