-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (46 loc) · 1.39 KB
/
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
43
44
45
46
47
48
49
name: Rails Tests
on:
push:
branches-ignore:
- master
workflow_call:
env:
RAILS_ENV: test
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:12-3.1
env:
POSTGRES_DB: klarschiff_backoffice_test
POSTGRES_PASSWORD: <password>
POSTGRES_USER: klarschiff_backoffice
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: '16'
- run: yarn install
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Prepare Config
run: |
rm config/database.yml
cp config/database.sample.yml config/database.yml
rm config/secrets.yml
cp config/secrets.sample.yml config/secrets.yml
rm config/storage.yml
cp config/storage.sample.yml config/storage.yml
- name: Prepare Database
run: bundle exec rails db:drop db:create db:schema:load
- name: Prepare Assets
run: bundle exec rails assets:precompile
- name: Run Rails Tests
run: bundle exec rails test -b -d