-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (48 loc) · 1.17 KB
/
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
41
42
43
44
45
46
47
48
name: Ruby
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- "3.2.2"
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: |
sudo apt-get install -y libvips
sudo apt-get install -yqq libpq-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Set up database
run: |
bundle exec rake db:create
bundle exec rake db:migrate
- name: Run test cases
run: bundle exec rake
# - name: Rubocop
# run: bundle exec rubocop --autocorrect