From 992d228158d5bc7af492d9509c137c8aa50869d3 Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Thu, 9 Mar 2023 23:07:22 +0000 Subject: [PATCH] Included publish GH action. Updated Readme to reflect download steps of prebuilt binaries --- .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++ README.md | 33 ++++++++++++++----------------- 3 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..78cf08a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +# .github/workflows/github-release-publish.yml +name: Publish artifacts to github release + +on: + release: + types: [published] + +jobs: + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + permissions: + id-token: write # To sign. + contents: write # To upload release assets. + actions: read # To read workflow path. + strategy: + fail-fast: false + matrix: + goos: [linux, darwin, windows] + goarch: [amd64, arm64] + steps: + - uses: actions/checkout@v3 + - uses: wangyoucao577/go-release-action@v1.36 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + binary_name: "redis-zbench-go" + sha256sum: true + asset_name: redis-zbench-go-${{ matrix.goos }}-${{ matrix.goarch }} + build_command: "make build" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f72088b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Flow tests + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + build: + name: build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + go-version: [1.18.x, 1.19.x, 1.20.x] + + services: + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 + ports: + - 6379:6379 + + steps: + - name: Set up ${{ matrix.go-version }} + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Test + run: make test diff --git a/README.md b/README.md index 89fd883..29dc0f0 100644 --- a/README.md +++ b/README.md @@ -7,31 +7,28 @@ Redis Sorted Sets Benchmark This repo contains code to trigger `load` ( `ZADD` ) or `query` (`ZRANGEBYLEX key min max`) benchmarks, with/without transaction, with/without pipelining, and with diversified ways of controlling the per-key size and total keyspace length. -## Install -### Standalone binaries ( no Golang needed ) +## Installation + +### Download Standalone binaries ( no Golang needed ) If you don't have go on your machine and just want to use the produced binaries you can download the following prebuilt bins: +https://github.com/redis-performance/redis-zbench-go/releases/latest + | OS | Arch | Link | | :--- | :---: | ---: | -| Windows | amd64 | [redis--go_windows_amd64.exe](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-zbench-go/unstable/redis-zbench-go_windows_amd64.exe) | -| Linux | amd64 | [redis-zbench-go_linux_amd64](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-zbench-go/unstable/redis-zbench-go_linux_amd64) | -| Linux | arm64 | [redis-zbench-go_linux_arm64](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-zbench-go/unstable/redis-zbench-go_linux_arm64) | -| Darwin | amd64 | [redis-zbench-go_darwin_amd64](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-zbench-go/unstable/redis-zbench-go_darwin_amd64) | -| Darwin | arm64 | [redis-zbench-go_darwin_arm64](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-zbench-go/unstable/redis-zbench-go_darwin_arm64) | - +| Linux | amd64 (64-bit X86) | [redis-zbench-go-linux-amd64](https://github.com/redis-performance/redis-zbench-go/releases/latest/download/redis-zbench-go-linux-amd64.tar.gz) | +| Linux | arm64 (64-bit ARM) | [redis-zbench-go-linux-arm64](https://github.com/redis-performance/redis-zbench-go/releases/latest/download/redis-zbench-go-linux-arm64.tar.gz) | +| Darwin | amd64 (64-bit X86) | [redis-zbench-go-darwin-amd64](https://github.com/redis-performance/redis-zbench-go/releases/latest/download/redis-zbench-go-darwin-amd64.tar.gz) | +| Darwin | arm64 (64-bit ARM) | [redis-zbench-go-darwin-arm64](https://github.com/redis-performance/redis-zbench-go/releases/latest/download/redis-zbench-go-darwin-arm64.tar.gz) | +Here's how bash script to download and try it: -Here's an example on how to use the above links: ```bash -# Fetch this repo -wget https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-zbench-go/unstable/redis-zbench-go_linux_amd64 - -# change permissions -chmod 755 redis-zbench-go_linux_amd64 +wget -c https://github.com/redis-performance/redis-zbench-go/releases/latest/download/redis-zbench-go-$(uname -mrs | awk '{ print tolower($1) }')-$(dpkg --print-architecture).tar.gz -O - | tar -xz -# give it a try -./redis-zbench-go_linux_amd64 --help +# give it a try +./redis-zbench-go --help ``` ### Installation in a Golang env @@ -40,8 +37,8 @@ The easiest way to get and install the benchmark utility with a Go Env is to use `go get` and then `go install`: ```bash # Fetch this repo -go get github.com/filipecosta90/redis-zbench-go -cd $GOPATH/src/github.com/filipecosta90/redis-zbench-go +go get github.com/redis-performance/redis-zbench-go +cd $GOPATH/src/github.com/redis-performance/redis-zbench-go make ```