-
Notifications
You must be signed in to change notification settings - Fork 5
174 lines (147 loc) · 5.23 KB
/
Copy pathci.yml
File metadata and controls
174 lines (147 loc) · 5.23 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
# PR runs are keyed by PR number (repo-assigned, so a fork branch named "main"
# cannot collide with and cancel trusted runs on this repo's main). Push and
# workflow_dispatch runs share a group per ref_name so a dispatched run is
# cancelled when a push supersedes it, and vice versa.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}
cancel-in-progress: true
jobs:
hygiene:
name: Go hygiene
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: true
- name: Check go.mod is tidy
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
- name: Run golangci-lint
run: make lint
test:
name: Go tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: true
- name: Download modules
run: go mod download
- name: Build
run: go build ./...
- name: Run tests
run: go tool gotestsum --format pkgname-and-test-fails --jsonfile=test-output-${{ matrix.os }}.json -- ./...
- name: Run go vet
run: go vet ./...
streaming-gates:
name: Streaming race and portability gates
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: true
- name: Run streaming race tests
run: go test -race ./pack ./packstore ./backup
- name: Compile streaming packages for Linux 386
env:
CGO_ENABLED: "0"
GOOS: linux
GOARCH: "386"
run: |
go test -c -o "${RUNNER_TEMP}/kit-pack-linux386.test" ./pack
go test -c -o "${RUNNER_TEMP}/kit-packstore-linux386.test" ./packstore
go test -c -o "${RUNNER_TEMP}/kit-backup-linux386.test" ./backup
- name: Compile fail-closed storage packages for Plan 9
env:
CGO_ENABLED: "0"
GOOS: plan9
GOARCH: amd64
run: |
go test -c -o "${RUNNER_TEMP}/kit-pack-plan9.test" ./pack
go test -c -o "${RUNNER_TEMP}/kit-packstore-plan9.test" ./packstore
- name: Verify current streamed packs with the v0.7.0 reader
run: |
go run ./tools/packstreamfixture -out "${RUNNER_TEMP}/current-stream.pack"
mkdir "${RUNNER_TEMP}/v070-reader"
cp tools/packv1reader/main.go "${RUNNER_TEMP}/v070-reader/main.go"
cd "${RUNNER_TEMP}/v070-reader"
go mod init compatibility-reader
go mod edit -require go.kenn.io/kit@v0.7.0
go mod tidy
go run . -pack "${RUNNER_TEMP}/current-stream.pack"
s3-conformance:
name: S3-compatible backend conformance
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: true
- name: Start S3-compatible service
run: |
docker run --detach --rm \
--name kit-s3-conformance \
--publish 9000:9000 \
--env MINIO_ROOT_USER=kit-test \
--env MINIO_ROOT_PASSWORD=kit-test-secret \
quay.io/minio/minio@sha256:a1ea29fa28355559ef137d71fc570e508a214ec84ff8083e39bc5428980b015e \
server /data
for attempt in $(seq 1 30); do
if curl --fail --silent --show-error \
http://127.0.0.1:9000/minio/health/ready >/dev/null; then
exit 0
fi
sleep 1
done
docker logs kit-s3-conformance
exit 1
- name: Run real-service conformance
env:
KIT_S3_TEST_ENDPOINT: http://127.0.0.1:9000
KIT_S3_TEST_ACCESS_KEY: kit-test
KIT_S3_TEST_SECRET_KEY: kit-test-secret
KIT_S3_TEST_BUCKET: kit-conformance
run: go test -race ./packstore/s3store