mirror of
https://github.com/redis/go-redis.git
synced 2025-04-17 20:17:02 +03:00
* chore: extract benchmark tests * wip * enable pubsub tests * enable ring tests * stop tests with build redis from source * start all tests * mix of makefile and action * add sentinel configs * fix example test * stop debug on re * wip * enable gears for redis 7.2 * wip * enable sentinel, they are expected to fail * fix: linter configuration * chore: update re versions * return older redis enterprise version * add basic codeql * wip: increase timeout, focus only sentinel tests * sentinels with docker network host * enable all tests * fix flanky test * enable example tests * tidy docker compose * add debug output * stop shutingdown masters * don't test sentinel for re * skip unsuported addscores * Update README bump go version in CI * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update CONTRIBUTING.md add information about new test setup --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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-M03" # 8.0 milestone 4
|
|
- "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-M03"]="8.0-M04-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-M03" # 8.0 milestone 4
|
|
- "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 }}
|
|
|