-
Notifications
You must be signed in to change notification settings - Fork 13
47 lines (40 loc) · 1.2 KB
/
run_tests.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
name: Run Tests
on:
pull_request: # run tests for all PRs
push: { branches: master } # only run tests on push / merges to master branch
env:
DATABASE_URL_TEST: postgresql://postgres:postgres@localhost/caesar_test
jobs:
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options:
--health-cmd pg_isready
--health-interval 10ms
--health-timeout 500ms
--health-retries 15
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check for focus specs
run: ./scripts/no_focus.sh
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7 # ensure we test the same ruby version we run under (see Dockerfile)
bundler-cache: true
- name: Setup test database
run: RAILS_ENV=test bin/rails db:create
- name: Run tests
run: RAILS_ENV=test bundle exec rspec # avoid running spring via bin/rspec binstub