-
Notifications
You must be signed in to change notification settings - Fork 9
48 lines (46 loc) · 1.35 KB
/
test.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: Tests
on:
push:
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
RAILS_ENV: test
PUSHER_URL: ${{ secrets.PUSHER_URL }}
CONVERTLOOP_APP_ID: ${{ secrets.CONVERTLOOP_APP_ID }}
CONVERTLOOP_KEY: ${{ secrets.CONVERTLOOP_KEY }}
CONVERTLOOP_HOST: ${{ secrets.CONVERTLOOP_HOST }}
REDISCLOUD_URL: ${{ secrets.REDIS_URL }}
steps:
- uses: actions/checkout@v2
- name: Cache Ruby Gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.6
- name: Start Redis
uses: supercharge/[email protected]
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Setup Database
run: |
cp config/database.yml.ci config/database.yml
bundle exec rake db:create
bundle exec rake db:schema:load
- name: Run tests
run: HEADLESS=true bundle exec rspec