-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·56 lines (50 loc) · 1.43 KB
/
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
48
49
50
51
52
53
54
name: Tests
on: [push]
env:
DATABASE_URL: postgres://localhost:5432/argentarii_test
PGHOST: localhost
PGUSER: postgres
RAILS_ENV: test
jobs:
rspec:
name: "Test suite"
runs-on: ubuntu-latest
# Example for can be found here:
# https://github.com/actions/example-services/tree/master/.github/workflows
services:
postgres:
image: postgres:14.5
env:
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_PASSWORD: ""
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.1
- uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.OS }}-gems
restore-keys: |
${{ runner.OS }}-gems
${{ runner.OS }}-gems-
${{ runner.OS }}-
- name: Install Ruby Gems
run: |
gem install bundler -v 2.4.8
bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
- name: Prepare application database
run: |
bin/rails db:create db:schema:load
- name: Prepare application assets
run: |
bin/rails tailwindcss:build
- name: Run Tests
run: |
bundle exec rspec spec