forked from globalize/globalize
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (57 loc) · 1.79 KB
/
test.yml
File metadata and controls
61 lines (57 loc) · 1.79 KB
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
name: CI
on:
push:
branches:
- 'master'
pull_request:
jobs:
test:
strategy:
matrix:
architecture: [ x64 ]
database: [ mysql, postgresql, sqlite3 ]
gemfile: [ '5.2.1', '5.1.6', '4.2.10' ]
ruby: [ '2.6.x', '2.5.x', '2.4.x' ]
fail-fast: false
runs-on: ubuntu-latest
name: ${{ matrix.ruby }} ${{ matrix.database }} rails-${{ matrix.gemfile }}
steps:
- uses: actions/setup-ruby@v1.0.0
with:
architecture: ${{ matrix.architecture }}
ruby-version: ${{ matrix.ruby }}
version: ${{ matrix.ruby }}
- uses: actions/checkout@v1
- run: sudo apt-get update
- run: sudo apt-get install libpq-dev postgresql-client -y
if: matrix.database == 'postgresql'
- run: sudo apt-get install libmysqlclient-dev -y
if: matrix.database == 'mysql'
- run: sudo apt-get install libsqlite3-dev -y
if: matrix.database == 'sqlite3'
- id: cache-bundler
uses: actions/cache@v1
with:
path: gemfiles/vendor/bundle
key: ${{ matrix.ruby }}-gem-${{ hashFiles(format('gemfiles/Gemfile.rails-{0}.rb', matrix.gemfile)) }}
- run: gem install bundler
- run: bundle install --path vendor/bundle
- run: bundle exec rake db:create db:migrate
- run: bundle exec rake test
env:
BUNDLE_GEMFILE: gemfiles/Gemfile.rails-${{ matrix.gemfile }}.rb
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor/bundle
CI: true
COVERALLS: true
DB: ${{ matrix.database }}
MYSQL_PASSWORD: root
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
RAILS_ENV: test
services:
postgres:
image: postgres:11.5
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5