|
|
|
@ -7,6 +7,27 @@ on:
|
|
|
|
jobs:
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
postgres:
|
|
|
|
|
|
|
|
image: postgres
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
|
|
|
|
POSTGRES_PASSWORD: ""
|
|
|
|
|
|
|
|
POSTGRES_DB: postgres
|
|
|
|
|
|
|
|
ports:
|
|
|
|
|
|
|
|
- 5432:5432
|
|
|
|
|
|
|
|
# needed because the postgres container does not provide a healthcheck
|
|
|
|
|
|
|
|
# tmpfs makes DB faster by using RAM
|
|
|
|
|
|
|
|
options: >-
|
|
|
|
|
|
|
|
--mount type=tmpfs,destination=/var/lib/postgresql/data
|
|
|
|
|
|
|
|
--health-cmd pg_isready
|
|
|
|
|
|
|
|
--health-interval 10s
|
|
|
|
|
|
|
|
--health-timeout 5s
|
|
|
|
|
|
|
|
--health-retries 5
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
|
|
|
RAILS_ENV: test
|
|
|
|
|
|
|
|
PGHOST: localhost
|
|
|
|
|
|
|
|
PGUSER: postgres
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Ruby
|
|
|
|
- name: Set up Ruby
|
|
|
|
@ -15,5 +36,8 @@ jobs:
|
|
|
|
bundler-cache: true
|
|
|
|
bundler-cache: true
|
|
|
|
- name: Install dependencies
|
|
|
|
- name: Install dependencies
|
|
|
|
run: bundle install
|
|
|
|
run: bundle install
|
|
|
|
|
|
|
|
- name: Create DB
|
|
|
|
|
|
|
|
run: |
|
|
|
|
|
|
|
|
bin/rails db:prepare
|
|
|
|
- name: Run tests
|
|
|
|
- name: Run tests
|
|
|
|
run: bundle exec rake
|
|
|
|
run: bundle exec rake
|
|
|
|
|