-
-
Notifications
You must be signed in to change notification settings - Fork 196
114 lines (108 loc) · 3.33 KB
/
lint-and-test.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
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
name: lint and test
on:
push:
branches: ["*"]
paths-ignore:
- '**/*.md'
pull_request:
branches: ["*"]
paths-ignore:
- '**/*.md'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
golangci:
if: github.repository == 'twmb/franz-go'
runs-on: ubuntu-latest
name: "golangci-lint on amd64"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.2
- uses: golangci/golangci-lint-action@v3
with:
version: latest
vet-arm:
if: github.repository == 'twmb/franz-go'
needs: golangci
runs-on: ubuntu-latest
name: "vet on arm"
steps:
- uses: actions/checkout@v3
with:
path: "repo"
- uses: uraimo/run-on-arch-action@v2
with:
arch: armv6
distro: bullseye
run: |
echo "updating"
apt-get -qq -y update
echo "installing wget"
apt-get -qq -y install wget
echo "downloading go"
wget --quiet https://go.dev/dl/go1.19.2.linux-armv6l.tar.gz
tar xzf go1.19.2.linux-armv6l.tar.gz
mkdir bins
export PATH=$(pwd)/go/bin:$(pwd)/bins:$PATH
export GOBIN=$(pwd)/bins
export CGO_ENABLED=0
cd repo
echo "go vet ./..."
go vet ./...
echo "installing staticcheck"
go install honnef.co/go/tools/cmd/staticcheck@latest
echo "staticcheck ./..."
staticcheck -checks 'all,-ST1003,-SA1012,-ST1016,-SA1019,-SA2001' ./... # actually contains atomicalign check
integration-test-kafka:
if: github.repository == 'twmb/franz-go'
needs: golangci
runs-on: ubuntu-latest
name: "integration test kafka"
container: golang:1.19.2
services:
kafka:
image: bitnami/kafka:latest
ports:
- 9092:9092
env:
KAFKA_ENABLE_KRAFT: yes
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: [email protected]:9093
# Set this to "PLAINTEXT://127.0.0.1:9092" if you want to run this container on localhost via Docker
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_CFG_BROKER_ID: 1
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_KRAFT_CLUSTER_ID: XkpGZQ27R3eTl3OdTm2LYA # 16 byte base64-encoded UUID
steps:
- uses: actions/checkout@v3
- run: go test ./...
env:
KGO_TEST_RF: 1
KGO_SEEDS: kafka:9092
KGO_TEST_UNSAFE: true
KGO_TEST_STABLE_FETCH: true
integration-test-redpanda:
if: github.repository == 'twmb/franz-go'
needs: golangci
runs-on: ubuntu-latest
name: "integration test redpanda"
container: golang:1.19.2
services:
redpanda:
image: vectorized/redpanda-nightly:latest
ports:
- 9092:9092
env:
REDPANDA_ADVERTISE_KAFKA_ADDRESS: redpanda:9092
steps:
- uses: actions/checkout@v3
- run: go test ./...
env:
KGO_TEST_RF: 1
KGO_SEEDS: redpanda:9092