-
Notifications
You must be signed in to change notification settings - Fork 251
46 lines (46 loc) · 1.57 KB
/
go-retryablehttp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build
on:
push:
jobs:
run-tests:
runs-on: ubuntu-latest
env:
TEST_RESULTS: "/tmp/test-results"
steps:
- name: Setup go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: 1.18
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- run: mkdir -p "$TEST_RESULTS"/go-retryablyhttp
- name: restore_cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: go-mod-v1-{{ checksum "go.sum" }}
restore-keys: go-mod-v1-{{ checksum "go.sum" }}
path: "/go/pkg/mod"
- run: go mod download
- run: go mod tidy
- name: Run go format
run: |-
files=$(go fmt ./...)
if [ -n "$files" ]; then
echo "The following file(s) do not conform to go fmt:"
echo "$files"
exit 1
fi
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Run unit tests
run: |-
PACKAGE_NAMES=$(go list ./...)
# shellcheck disable=SC2086 # can't quote package list
gotestsum --junitfile "${TEST_RESULTS}"/go-retryablyhttp/gotestsum-report.xml -- $PACKAGE_NAMES
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
path: "/tmp/test-results"
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
path: "/tmp/test-results"
permissions:
contents: read