Skip to content

Commit b76183a

Browse files
committed
add "lint and test" workflow
* First golangci-lint * Then ensure we do not have atomic alignment problems on 32 bit
1 parent 5bc6923 commit b76183a

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/lint-and-test.yml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: lint and test
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
pull_request:
7+
branches: ["*"]
8+
9+
concurrency:
10+
group: ${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
golangci:
15+
if: github.repository == 'twmb/franz-go'
16+
runs-on: ubuntu-latest
17+
name: 'golangci-lint on amd64'
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-go@v3
21+
with:
22+
go-version: 1.19.2
23+
- uses: golangci/golangci-lint-action@v3
24+
with:
25+
version: latest
26+
27+
vet-arm:
28+
if: github.repository == 'twmb/franz-go'
29+
needs: golangci
30+
runs-on: ubuntu-latest
31+
name: 'vet on arm'
32+
steps:
33+
- uses: actions/checkout@v3
34+
with:
35+
path: "repo"
36+
- uses: uraimo/run-on-arch-action@v2
37+
with:
38+
arch: armv6
39+
distro: bullseye
40+
githubToken: ${{ github.token }}
41+
run: |
42+
echo "updating"
43+
apt-get -qq -y update
44+
echo "installing wget"
45+
apt-get -qq -y install wget
46+
echo "downloading go"
47+
wget --quiet https://go.dev/dl/go1.19.2.linux-armv6l.tar.gz
48+
tar xzf go1.19.2.linux-armv6l.tar.gz
49+
mkdir bins
50+
export PATH=$(pwd)/go/bin:$(pwd)/bins:$PATH
51+
export GOBIN=$(pwd)/bins
52+
export CGO_ENABLED=0
53+
cd repo
54+
echo "go vet ./..."
55+
go vet ./...
56+
echo "installing staticcheck"
57+
go install honnef.co/go/tools/cmd/staticcheck@latest
58+
echo "staticcheck ./..."
59+
staticcheck -checks 'all,-ST1003,-SA1012,-ST1016,-SA1019,-SA2001' ./... # actually contains atomicalign check
60+
61+
# TODO: fix
62+
# integration-test:
63+
# if: github.repository == 'twmb/franz-go'
64+
# needs: golangci
65+
# runs-on: ubuntu-latest
66+
# name: 'integration test kafka'
67+
# container: golang:1.19.2
68+
# services:
69+
# zk:
70+
# image: bitnami/zookeeper:latest
71+
# ports:
72+
# - 2181:2181
73+
# env:
74+
# ALLOW_ANONYMOUS_LOGIN: yes
75+
# kafka:
76+
# image: bitnami/kafka:latest
77+
# ports:
78+
# - 9092:9092
79+
# env:
80+
# ALLOW_PLAINTEXT_LISTENER: yes
81+
# KAFKA_CFG_ZOOKEEPER_CONNECT: zk:2181
82+
# steps:
83+
# - uses: actions/checkout@v3
84+
# - run: go test ./...
85+
# env:
86+
# KGO_TEST_RF: 1
87+
# KGO_SEEDS: kafka:9092
88+
# KGO_TEST_RECORDS: 50000

0 commit comments

Comments
 (0)