Skip to content

Commit 891a156

Browse files
authored
Merge branch 'scylladb:master' into extended_version_info
2 parents fa9dd0c + c56dbe4 commit 891a156

15 files changed

+413
-76
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
coverage.txt

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: /
6+
schedule:
7+
interval: "monthly"
8+
9+
- package-ecosystem: "gomod"
10+
directory: /
11+
schedule:
12+
interval: "weekly"

.github/workflows/docker.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Build and Push docker image to scylladb/scylla-bench"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
default: "dev"
8+
required: false
9+
type: string
10+
secrets:
11+
DOCKERHUB_TOKEN:
12+
required: true
13+
DOCKERHUB_USERNAME:
14+
required: true
15+
workflow_dispatch:
16+
inputs:
17+
version:
18+
default: ""
19+
required: true
20+
type: string
21+
22+
jobs:
23+
build-and-push:
24+
runs-on: ubuntu-24.04
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
# Needed for ARM64 Docker builds
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Login to dockerhub
39+
uses: docker/login-action@v3
40+
with:
41+
username: ${{ secrets.DOCKERHUB_USERNAME }}
42+
password: ${{ secrets.DOCKERHUB_TOKEN }}
43+
- name: Build and Push docker image to scylladb/scylla-bench
44+
uses: docker/build-push-action@v6
45+
with:
46+
file: ./Dockerfile
47+
context: .
48+
push: true
49+
pull: true
50+
platforms: 'linux/amd64,linux/arm64/v8'
51+
target: production
52+
cache-from: type=gha
53+
cache-to: type=gha,mode=max
54+
tags: |
55+
scylladb/scylla-bench:${{ inputs.version }}
56+
scylladb/scylla-bench:latest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Update Docker Hub Description
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- README.md
8+
- .github/workflows/dockerhub-description.yml
9+
jobs:
10+
update-dockerhub-description:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Update Docker Hub Description for scylladb/scylla-bench
15+
uses: peter-evans/dockerhub-description@v4
16+
with:
17+
username: ${{ secrets.DOCKERHUB_USERNAME }}
18+
password: ${{ secrets.DOCKERHUB_TOKEN }}
19+
repository: scylladb/scylla-bench
20+
short-description: ${{ github.event.repository.description }}
21+
enable-url-completion: true

.github/workflows/go.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Lint and Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-lint-test:
12+
name: Build Lint and Test
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Setup Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.17'
20+
- name: Build
21+
run: make build
22+
- name: Linting
23+
run: make check
24+
- name: Set up gotestfmt
25+
uses: GoTestTools/gotestfmt-action@v2
26+
with:
27+
repo: gotestfmt
28+
version: v2.2.0
29+
- name: Unit Tests
30+
run: make test

.github/workflows/release.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release scylla-bench
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
issues: write
12+
id-token: write
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: '1.23.3'
27+
28+
# Needed for ARM64 Docker builds
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v3
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Login to dockerhub
36+
uses: docker/login-action@v3
37+
with:
38+
username: ${{ secrets.DOCKERHUB_USERNAME }}
39+
password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
41+
- name: Run GoReleaser
42+
uses: goreleaser/goreleaser-action@v6
43+
with:
44+
distribution: goreleaser
45+
version: "v2.4.5"
46+
args: release --clean
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
build/
22
.idea
33
scylla-bench
4+
coverage.txt
5+
dist/

.golangci.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
run:
2+
concurrency: 8
3+
timeout: 10m
4+
issues-exit-code: 1
5+
tests: true
6+
modules-download-mode: mod
7+
allow-parallel-runners: true
8+
go: '1.23'
9+
10+
output:
11+
print-issued-lines: true
12+
print-linter-name: true
13+
sort-results: true
14+
15+
issues:
16+
max-same-issues: 1
17+
max-issues-per-linter: 10
18+
exclude:
19+
- Error return value of `.*.Unlock` is not checked
20+
- Error return value of `.*.Completed` is not checked
21+
linters:
22+
disable-all: true
23+
enable:
24+
- asasalint
25+
- bidichk
26+
- errcheck
27+
- govet
28+
- bodyclose
29+
- ineffassign
30+
- unused
31+
- durationcheck
32+
- goheader
33+
- goimports
34+
- misspell
35+
- gofumpt
36+
- gosimple
37+
- staticcheck
38+
- decorder
39+
- lll
40+
- errorlint
41+
- gocritic
42+
- predeclared
43+
- revive
44+
- thelper
45+
- tparallel
46+
- typecheck
47+
- unused
48+
- gomodguard
49+
- gocyclo
50+
- nilerr
51+
- makezero
52+
- wastedassign
53+
- prealloc
54+
55+
56+
linters-settings:
57+
govet:
58+
settings:
59+
shadow:
60+
strict: true
61+
enable-all: true
62+
gocyclo:
63+
min-complexity: 50
64+
lll:
65+
line-length: 180
66+
gofumpt:
67+
extra-rules: true
68+
goimports:
69+
local-prefixes: github.com/scylladb/scylla-bench

.goreleaser.yml

+72-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,84 @@
1-
env:
2-
- GO111MODULE=on
3-
before:
4-
hooks:
5-
- go mod download
1+
version: 2
2+
3+
report_sizes: true
4+
65
builds:
7-
-
8-
env:
9-
- CGO_ENABLED=0
6+
- id: scylla-bench
107
goos:
118
- linux
9+
binary: scylla-bench
10+
no_unique_dist_dir: false
11+
env:
12+
- CGO_ENABLED=0
13+
- CFLAGS="-O3"
14+
- CXXFLAGS="-O3"
1215
goarch:
1316
- amd64
14-
archive:
15-
replacements:
16-
darwin: Darwin
17-
linux: Linux
18-
windows: Windows
19-
386: i386
20-
amd64: x86_64
17+
- arm64
18+
main: .
19+
goamd64:
20+
- v3 # v3 Enables AMD64 SIMD (SSE4.x,AVX2) optimizations
21+
goarm64:
22+
- v8.3 # ARM crypto extension for RANDOM Number generation
23+
24+
archives:
25+
- name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
26+
files:
27+
- README.md
28+
29+
source:
30+
enabled: true
31+
format: 'tar.gz'
32+
2133
checksum:
2234
name_template: 'checksums.txt'
35+
2336
snapshot:
24-
name_template: "{{ .Tag }}-next"
37+
version_template: '{{ .Tag }}-next'
38+
2539
changelog:
2640
sort: asc
2741
filters:
2842
exclude:
29-
- '^docs:'
30-
- '^test:'
43+
- '^docs:'
44+
- '^test:'
45+
46+
dockers:
47+
- image_templates:
48+
- scylladb/scylla-bench:{{ .Version }}-amd64
49+
goarch: amd64
50+
goamd64: v3
51+
goos: linux
52+
id: scylla-bench-amd64
53+
build_flag_templates:
54+
- '--platform=linux/amd64/v3'
55+
- '--target=goreleaser-production'
56+
57+
- image_templates:
58+
- scylladb/scylla-bench:{{ .Version }}-arm64v8
59+
goarch: arm64
60+
id: scylla-bench-arm
61+
goos: linux
62+
build_flag_templates:
63+
- '--platform=linux/arm64/v8'
64+
- '--target=goreleaser-production'
65+
66+
docker_manifests:
67+
- name_template: 'scylladb/scylla-bench:{{ .Version }}'
68+
skip_push: false
69+
image_templates:
70+
- 'scylladb/scylla-bench:{{ .Version }}-amd64'
71+
- 'scylladb/scylla-bench:{{ .Version }}-arm64v8'
72+
73+
- name_template: 'scylladb/scylla-bench:latest'
74+
skip_push: false
75+
image_templates:
76+
- 'scylladb/scylla-bench:{{ .Version }}-amd64'
77+
- 'scylladb/scylla-bench:{{ .Version }}-arm64v8'
78+
79+
release:
80+
mode: keep-existing
81+
make_latest: true
82+
prerelease: auto
83+
skip_upload: false
84+
include_meta: true

CHANGELOG.md

Whitespace-only changes.

0 commit comments

Comments
 (0)