houston/houston-core

View on GitHub
.github/workflows/tests.yml

Summary

Maintainability
Test Coverage
name: Tests
on: [push]

jobs:
  ruby:
    name: Tests
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        ruby: [2.5, 2.6, 2.7]
        postgres: [10]
    services:
      postgres:
        image: postgres:${{ matrix.postgres }}
        env:
          POSTGRES_DB: houston_core_test
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
        ports:
          - 5432:5432
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Ruby Setup
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
      - name: Bundle
        run: |
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3
      - name: Run the tests
        env:
          DATABASE_URL: postgres://postgres:postgres@localhost:5432/houston_core_test
          RAILS_ENV: test
          COVERAGE: on
          CI: true
        run: |
          bundle exec rails db:test:prepare
          bundle exec rails test