-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (48 loc) · 1.51 KB
/
rspec-test-suite.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
# This workflow uses actions that are not certified by GitHub. They are
# provided by a third-party and are governed by separate terms of service,
# privacy policy, and support documentation.
#
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "run the rspec test suite"
on:
pull_request:
branches: '**'
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
ports:
- "5432:5432"
env:
POSTGRES_DB: staffplan_redux_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
env:
RAILS_ENV: test
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/rails_test"
PREFAB_DATASOURCES: LOCAL_ONLY
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Set up database schema
env:
DATABASE_URL: ${{ env.DATABASE_URL }}
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bin/rails db:create db:schema:load
- name: Precompile Rails assets
env:
DATABASE_URL: ${{ env.DATABASE_URL }}
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bin/rails assets:precompile
- name: Run tests
env:
DATABASE_URL: ${{ env.DATABASE_URL }}
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bundle exec rspec