-
Notifications
You must be signed in to change notification settings - Fork 8
38 lines (36 loc) · 1014 Bytes
/
workflow.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
env:
RUBY_VERSION: 3.2.2
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
name: Rails Tests
on: [push, pull_request]
jobs:
rspec-test:
name: RSpec
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:latest
ports: ["5432:5432"]
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: Install PostgreSQL
run: sudo apt-get install libpq-dev
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Setup database
run: |
cp config/database.yml.ci config/database.yml
bundle exec rails db:create RAILS_ENV=test
bundle exec rails db:migrate RAILS_ENV=test
- name: Run tests
run: bundle exec rspec spec