-
Notifications
You must be signed in to change notification settings - Fork 16
54 lines (47 loc) · 1.46 KB
/
rspec.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: Run RSpec
on:
workflow_call:
inputs:
ref:
description: 'The branch, tag or SHA to checkout'
required: false
type: string
publishingApiRef:
description: 'The branch, tag or SHA to checkout Publishing API'
required: false
default: 'main'
type: string
jobs:
run-rspec:
name: Run RSpec
runs-on: ubuntu-latest
steps:
- name: Setup Postgres
id: setup-postgres
uses: alphagov/govuk-infrastructure/.github/actions/setup-postgres@main
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: alphagov/content-store
ref: ${{ inputs.ref || github.ref }}
- name: Checkout Publishing API (for Content Schemas)
uses: actions/checkout@v4
with:
repository: alphagov/publishing-api
ref: ${{ inputs.publishingApiRef }}
path: vendor/publishing-api
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Initialize database
env:
RAILS_ENV: test
TEST_DATABASE_URL: ${{ steps.setup-postgres.outputs.db-url }}
run: bundle exec rails db:setup
- name: Run RSpec
env:
RAILS_ENV: test
TEST_DATABASE_URL: ${{ steps.setup-postgres.outputs.db-url }}
GOVUK_CONTENT_SCHEMAS_PATH: vendor/publishing-api/content_schemas
run: bundle exec rake spec