mirror of
https://github.com/redis/go-redis.git
synced 2025-04-16 09:23:06 +03:00
* use m05 * add platform, since client-libs has image for amd64 * verbose testing * Update .github/workflows/build.yml
98 lines
2.6 KiB
YAML
98 lines
2.6 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [master, v9, v9.7]
|
|
pull_request:
|
|
branches: [master, v9, v9.7]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
|
|
benchmark:
|
|
name: benchmark
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
redis-version:
|
|
- "8.0-M05" # 8.0 milestone 5
|
|
- "7.4.2" # should use redis stack 7.4
|
|
go-version:
|
|
- "1.23.x"
|
|
- "1.24.x"
|
|
|
|
steps:
|
|
- name: Set up ${{ matrix.go-version }}
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Test environment
|
|
env:
|
|
REDIS_VERSION: ${{ matrix.redis-version }}
|
|
CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ matrix.redis-version }}"
|
|
run: |
|
|
set -e
|
|
redis_version_np=$(echo "$REDIS_VERSION" | grep -oP '^\d+.\d+')
|
|
|
|
# Mapping of redis version to redis testing containers
|
|
declare -A redis_version_mapping=(
|
|
["8.0-M05"]="8.0-M05-pre"
|
|
["7.4.2"]="rs-7.4.0-v2"
|
|
)
|
|
if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
|
|
echo "REDIS_VERSION=${redis_version_np}" >> $GITHUB_ENV
|
|
echo "REDIS_IMAGE=redis:${{ matrix.redis-version }}" >> $GITHUB_ENV
|
|
echo "CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test:${redis_version_mapping[$REDIS_VERSION]}" >> $GITHUB_ENV
|
|
else
|
|
echo "Version not found in the mapping."
|
|
exit 1
|
|
fi
|
|
shell: bash
|
|
- name: Set up Docker Compose environment with redis ${{ matrix.redis-version }}
|
|
run: make docker.start
|
|
shell: bash
|
|
- name: Benchmark Tests
|
|
env:
|
|
RCE_DOCKER: "true"
|
|
RE_CLUSTER: "false"
|
|
run: make bench
|
|
shell: bash
|
|
|
|
test-redis-ce:
|
|
name: test-redis-ce
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
redis-version:
|
|
- "8.0-M05" # 8.0 milestone 5
|
|
- "7.4.2" # should use redis stack 7.4
|
|
- "7.2.7" # should redis stack 7.2
|
|
go-version:
|
|
- "1.23.x"
|
|
- "1.24.x"
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Run tests
|
|
uses: ./.github/actions/run-tests
|
|
with:
|
|
go-version: ${{matrix.go-version}}
|
|
redis-version: ${{ matrix.redis-version }}
|
|
|
|
- name: Upload to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
files: coverage.txt
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|