chore: make sure to run the CI on latest Go versions #4923
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| name: Go | |
| on: | |
| push: | |
| branches: [master, v9, 'v9.*'] | |
| pull_request: | |
| branches: [master, v9, v9.7, v9.8, 'ndyakov/*', 'ofekshenawa/*', 'htemelski-redis/*', 'ce/*'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| benchmark: | |
| name: benchmark | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| redis-version: | |
| - "8.4.x" # Redis CE 8.4 | |
| - "8.2.x" # Redis CE 8.2 | |
| - "8.0.x" # Redis CE 8.0 | |
| go-version: | |
| - "stable" # The latest stable Go release | |
| - "oldstable" # The previous Go release before stable | |
| steps: | |
| - name: Set up ${{ matrix.go-version }} | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - 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.4.x"]="8.4.0" | |
| ["8.2.x"]="8.2.1-pre" | |
| ["8.0.x"]="8.0.2" | |
| ) | |
| 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.4.x" # Redis CE 8.4 | |
| - "8.2.x" # Redis CE 8.2 | |
| - "8.0.x" # Redis CE 8.0 | |
| go-version: | |
| - "stable" # The latest stable Go release | |
| - "oldstable" # The previous Go release before stable | |
| - "1.18.x" # Go 1.18 is the minimum supported version for go-redis (see go.mod) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - 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 }} | |