test: update test suite configuration #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Specs Rails 6.0 Postgres | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby: ['2.6', '2.7', '3.0'] | |
gemfile: ['rails_6_0_postgres'] | |
env: | |
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | |
DB_TEST: postgres | |
PG_DB_HOST: 127.0.0.1 | |
PG_DB_USERNAME: postgres | |
PG_DB_PASSWORD: postgres | |
RAILS: '6.0' | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Create database | |
run: bundle exec rails db:create | |
- name: Apply migrations | |
run: bundle exec rails db:migrate | |
- name: Run tests | |
run: bundle exec rspec --profile | |
# - name: Upload coverage results | |
# uses: actions/upload-artifact@main | |
# if: always() | |
# with: | |
# name: coverage-report | |
# path: coverage/index.html |