Skip to content

Roblox-ActionsCache/shogo82148-actions-setup-redis

Repository files navigation

actions-setup-redis

GitHub Actions status

This action sets by redis database for use in actions by:

  • optionally downloading and caching a version of redis
  • start redis-server

Motivation

  • GitHub Actions supports Docker services, and there is the official redis image. but it works on only Linux.
  • Some test utils for redis (such as Test::RedisServer) requires redis-server installed on the local host.

Usage

See action.yml

Basic:

steps:
- uses: actions/checkout@v2
- uses: shogo82148/actions-setup-redis@v1
  with:
    redis-version: '6.x'
- run: redis-cli ping

Matrix Testing:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
        - 'ubuntu-latest'
        - 'macOS-latest'
        # - 'windows-latest' # windows is currently not supported.
        redis:
        - '6.2'
        - '6.0'
        - '5.0'
        - '4.0'
    name: Redis ${{ matrix.redis }} on ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Setup redis
        uses: shogo82148/actions-setup-redis@v1
        with:
          redis-version: ${{ matrix.redis }}
          auto-start: "false"

      - name: tests with Test::RedisServer
        run: |
          cpanm Test::RedisServer
          prove -lv t

License

The scripts and documentation in this project are released under the MIT License