Skip to content

Commit 4ba507a

Browse files
committed
ci: Test on both Ruby 2.5 and 2.6
1 parent 66a9675 commit 4ba507a

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed

.travis.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,49 @@
1+
sudo: false
2+
3+
# "test" step configuration
14
language: ruby
5+
rvm:
6+
- 2.6
7+
- 2.5
28
cache:
39
bundler: true
4-
sudo: false
510
bundler_args: --path vendor --local --without development
611
addons:
712
code_climate:
813
repo_token: a42e116d4d68894b025a60cb722a0b9ba2cf1c6497debb02993d0702284d2511
14+
before_install:
15+
# Ensure an up-to-date bundler version is used, otherwise fails on Ruby 2.5
16+
- bundle update --bundler
17+
before_script:
18+
- mysql -u root -e "CREATE DATABASE myapp_test;"
19+
- mysql -u root -e "GRANT ALL PRIVILEGES ON myapp_test.* TO 'travis'@'%';";
20+
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
21+
- export DATABASE_URL="mysql2://travis@localhost/myapp_test"
22+
script:
23+
- bin/rails db:migrate
24+
- RUN_COVERAGE=travis bin/rails test
25+
- bin/rails coverage:report
26+
27+
# "deploy" step configuration
928
jobs:
1029
include:
11-
- stage: Tests
12-
env:
13-
- DATABASE_URL="mysql2://travis@localhost/myapp_test"
14-
before_script:
15-
- mysql -u root -e "CREATE DATABASE myapp_test;"
16-
- mysql -u root -e "GRANT ALL PRIVILEGES ON myapp_test.* TO 'travis'@'%';";
17-
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
18-
script:
19-
- bin/rails db:migrate
20-
- RUN_COVERAGE=travis bin/rails test
21-
- bin/rails coverage:report
22-
- stage: Release + website update
30+
- stage: deploy
31+
name: Build & publish new release (if needed)
2332
if: branch = master
2433
language: node_js
2534
node_js: lts/*
2635
cache:
2736
yarn: true
28-
script: skip
29-
deploy:
30-
provider: script
31-
skip_cleanup: true
32-
script:
33-
- yarn semantic-release
34-
- # stage name not required, will continue to use `Release + website update`
37+
before_install: skip
38+
before_script: skip
39+
script: yarn semantic-release
40+
- stage: deploy
41+
name: Push docs website update
3542
if: branch = master
3643
language: node_js
3744
node_js: lts/*
3845
cache:
3946
yarn: true
40-
script: skip
41-
deploy:
42-
provider: script
43-
skip_cleanup: true
44-
script: bash website/travis-deploy.sh
47+
before_install: skip
48+
before_script: skip
49+
script: bash website/travis-deploy.sh

0 commit comments

Comments
 (0)