openSNP/snpr

View on GitHub
.github/workflows/build.yml

Summary

Maintainability
Test Coverage
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Ruby

on:
  push: {}
  pull_request:
    branches: [master]

jobs:
  tests:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:9.5
        env:
          POSTGRES_PASSWORD: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432

      redis:
        image: redis
        ports:
          - 6379:6379

    env:
      DATABASE_URL: postgres://postgres:postgres@localhost/snpr

    steps:
      - name: Install hiredis
        run: |
          sudo apt-get install -y libhiredis-dev

      - uses: actions/checkout@v2

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true

      - name: Setup database
        run: bundle exec rake db:reset

      - name: Run tests
        run: bundle exec rake