-
Notifications
You must be signed in to change notification settings - Fork 53
42 lines (40 loc) · 1.09 KB
/
unit_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
name: Unit Tests
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_FROZEN: true
CI: true
DATABASE_URL: postgres://postgres:postgres@localhost:5432
RAILS_ENV: test
services:
postgres:
image: postgres:16.0
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:6.2-alpine
ports: ["6379:6379"]
options: --health-cmd="redis-cli ping" --health-interval 1s --health-timeout 3s --health-retries 30
steps:
- uses: actions/checkout@v3
- name: Install PostgreSQL client
run: |
sudo apt-get -yqq install libpq-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
- name: Run RSpec
run: |
bundle exec rails db:test:prepare
bundle exec rspec --tag ~type:system --force-color