-
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 1.86 KB
/
run-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
55
56
57
58
59
60
61
62
63
64
65
66
67
# This reusable workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# Matrix testing with different Ruby versions and Postgres versions is supported.
name: Tests
on:
workflow_call:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['.ruby-version' ]
postgres-version: [ '13', 'latest' ]
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Set up Ruby
# It uses v1 as a code for "The latest version with automatic fixes etc.", referred to as a floating V1
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Set up database schema
run: bin/rails db:setup
env:
SERVER_PRODUCTION: www.nothing.fish
SERVER_STAGING: www.nothing.fish
SERVER_DEVELOPMENT: www.nothing.fish
HOST_PORT: 80
COMMITTEE: 12.5
REQ_URL: https://www.nothing.fish/items/%s
MAIL_SENDER: admin@nothingfish.org
- name: Run tests
run: bundle exec rake
env:
SERVER_PRODUCTION: www.nothing.fish
SERVER_STAGING: www.nothing.fish
SERVER_DEVELOPMENT: www.nothing.fish
HOST_PORT: 80
COMMITTEE: 12.5
REQ_URL: https://www.nothing.fish/items/%s
MAIL_SENDER: admin@nothingfish.org