...

Text file src/github.com/redis/go-redis/v9/.github/workflows/build.yml

Documentation: github.com/redis/go-redis/v9/.github/workflows

     1name: Go
     2
     3on:
     4  push:
     5    branches: [master, v9, v9.7, v9.8, 'ndyakov/*', 'ofekshenawa/*', 'htemelski-redis/*', 'ce/*']
     6  pull_request:
     7    branches: [master, v9, v9.7, v9.8, 'ndyakov/*', 'ofekshenawa/*', 'htemelski-redis/*', 'ce/*']
     8
     9permissions:
    10  contents: read
    11
    12jobs:
    13
    14  benchmark:
    15    name: benchmark
    16    runs-on: ubuntu-latest
    17    strategy:
    18      fail-fast: false
    19      matrix:
    20        redis-version:
    21          - "8.2.x" # Redis CE 8.2
    22          - "8.0.x" # Redis CE 8.0
    23          - "7.4.x" # Redis stack 7.4
    24        go-version:
    25          - "1.23.x"
    26          - "1.24.x"
    27
    28    steps:
    29      - name: Set up ${{ matrix.go-version }}
    30        uses: actions/setup-go@v6
    31        with:
    32          go-version: ${{ matrix.go-version }}
    33
    34      - name: Checkout code
    35        uses: actions/checkout@v5
    36
    37      - name: Setup Test environment
    38        env:
    39          REDIS_VERSION: ${{ matrix.redis-version }}
    40          CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ matrix.redis-version }}"
    41        run: |
    42          set -e
    43          redis_version_np=$(echo "$REDIS_VERSION" | grep -oP '^\d+.\d+')
    44          
    45          # Mapping of redis version to redis testing containers
    46          declare -A redis_version_mapping=(
    47            ["8.2.x"]="8.2.1-pre"
    48            ["8.0.x"]="8.0.2"
    49            ["7.4.x"]="rs-7.4.0-v5"
    50          )
    51          if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
    52            echo "REDIS_VERSION=${redis_version_np}" >> $GITHUB_ENV
    53            echo "REDIS_IMAGE=redis:${{ matrix.redis-version }}" >> $GITHUB_ENV
    54            echo "CLIENT_LIBS_TEST_IMAGE=redislabs/client-libs-test:${redis_version_mapping[$REDIS_VERSION]}" >> $GITHUB_ENV
    55          else
    56            echo "Version not found in the mapping."
    57            exit 1
    58          fi
    59        shell: bash
    60      - name: Set up Docker Compose environment with redis ${{ matrix.redis-version }}
    61        run: make docker.start
    62        shell: bash
    63      - name: Benchmark Tests
    64        env:
    65          RCE_DOCKER: "true"
    66          RE_CLUSTER: "false"
    67        run: make bench
    68        shell: bash
    69
    70  test-redis-ce:
    71    name: test-redis-ce
    72    runs-on: ubuntu-latest
    73    strategy:
    74        fail-fast: false
    75        matrix:
    76          redis-version:
    77            - "8.2.x" # Redis CE 8.2
    78            - "8.0.x" # Redis CE 8.0
    79            - "7.4.x" # Redis stack 7.4
    80            - "7.2.x" # Redis stack 7.2
    81          go-version:
    82            - "1.23.x"
    83            - "1.24.x"
    84
    85    steps:
    86      - name: Checkout code
    87        uses: actions/checkout@v5
    88
    89      - name: Run tests
    90        uses: ./.github/actions/run-tests
    91        with:
    92          go-version: ${{matrix.go-version}}
    93          redis-version: ${{ matrix.redis-version }}
    94
    95      - name: Upload to Codecov
    96        uses: codecov/codecov-action@v5
    97        with:
    98          files: coverage.txt
    99          token: ${{ secrets.CODECOV_TOKEN }}
   100

View as plain text