-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (54 loc) · 1.59 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
50
51
52
53
54
55
56
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
LANGUAGE: nb
PGUSER: postgres
PGPASSWORD: password
RAILS_ENV: test
jobs:
Rubocop:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Rubocop
run: bundle exec rubocop --auto-correct-all
Test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: [ 3.3, 3.2, 3.1, jruby, truffleruby ]
gemfile: [ ar71, ar70 ]
adapter: [ postgresql, sqlite3 ]
exclude:
- ruby: jruby
- ruby: truffleruby
env:
ADAPTER: ${{ matrix.adapter }}
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/gems_${{ matrix.gemfile }}.rb
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Rake test
run: bundle exec rake test