Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial CI #28

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/crystal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Crystal CI

on:
- push
- pull_request

jobs:
build:

runs-on: ubuntu-latest

container:
image: crystallang/crystal

services:
redis:
image: redis/redis-stack-server
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: shards install
- name: Run tests
run: crystal spec
env:
REDIS_URL: redis://redis/
2 changes: 1 addition & 1 deletion src/connection.cr
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Redis
# SSL connections require specifying the `rediss://` scheme.
# Password authentication uses the URI password.
# DB selection uses the URI path.
def initialize(@uri = URI.parse("redis:///"))
def initialize(@uri = URI.parse(ENV.fetch("REDIS_URL", "redis:///")))
host = uri.host.presence || "localhost"
port = uri.port || 6379
socket = TCPSocket.new(host, port)
Expand Down