Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Redis

name: CI

on:
  push:
  pull_request:
  workflow_dispatch:
  schedule:
    - cron: '42 5 * * *'

jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        redis: ['6.0', '7.0', 'latest']
        #redis: ['latest']
    services:
      redis:
        image: redis:${{matrix.redis}}

    runs-on: ubuntu-latest
    container: ubuntu:22.10

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Install curl and ping
        run: |
          apt-get update
          apt-get install -y iputils-ping
          apt-get install -y curl
          apt-get install -y redis-tools

      - name: ping redis
        run: |
          ping -c 4 redis

      - name: Redis CLI
        run: |
          set -x
          redis-cli -h redis get name
          redis-cli -h redis set name "Foo Bar"
          redis-cli -h redis get name

      #- name: Redis with curl
      #  run: |
      #    set -x
      #    # curl http://redis:8001/
      #    # curl http://redis:8888/ping   # Failed to connect to redis port 8888   - exit 7
      #    # curl -w '\n' http://redis:8888/ping
      #    # curl -X GET -H "accept: application/json"  http://redis:9443/v1/bdbs -k -i  # failed to connect - exit code 7
      #    # curl -X GET -H "accept: application/json"  http://redis:6379/v1/bdbs -k -i  # Empty reply from server - exit code 52
      #    # curl -X GET -H "accept: application/json" http://redis:6379/ping #  Empty reply from server - exit code 52
      #    # curl -X GET -H "accept: application/json" http://redis:6379 #  Empty reply from server - exit code 52
      #    # curl -X GET -H "accept: application/json" http://redis:6379/v1/get/name #  Empty reply from server - exit code 52