-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 962 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Unit tests
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
services:
db:
image: postgres:11
ports: [ '5432:5432' ]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: 12345
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.6
- name: Run the default task
env:
DB_HOST: localhost
DB_USERNAME: postgres
PGPASSWORD: 12345
RAILS_ENV: test
run: |
sudo apt-get -yqq install libpq-dev
gem install bundler -v 2.5.23
mv .env.test .env
bundle install
bundle exec rails db:create
bundle exec rails db:migrate
bundle exec rails db:seed
bundle exec rspec