forked from publiclab/mapknitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
executable file
·75 lines (66 loc) · 1.83 KB
/
.travis.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
68
69
70
71
72
73
74
75
language: ruby
rvm:
- 2.4.6
node_js:
- "12.6.0"
services:
- mysql
- docker
cache:
directories:
- $PWD/node_modules/
- $PWD/vendor/.bundle/
before_install:
- npm i -g [email protected]
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.17.3
- export PATH="$HOME/.yarn/bin:$PATH"
install:
- cp config/database.yml.example config/database.yml
- cp config/config.yml.example config/config.yml
- cp db/schema.rb.example db/schema.rb
- ./lib/exporter-deps.sh > /dev/null 2>&1
- bundle check --path vendor/.bundle/ || bundle install --path vendor/.bundle/
- if [ $RAILS_ENV != 'production' ]; then
yarn check || yarn install;
fi
- if [ $RAILS_ENV == 'production' ]; then
mysql -e "CREATE DATABASE mapknitter;";
mysql -e "CREATE USER 'mapknitter'@'%' IDENTIFIED BY 'mapknitter';";
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'mapknitter'@'%';";
bundle exec rails db:schema:load;
else
bundle exec rails db:setup || bundle exec rails db:migrate;
fi
env:
global:
- RAILS_ENV=test
- CI=true
- TRAVIS=true
- DB_HOST='127.0.0.1'
- DB_USER='mapknitter'
- DB_PASS='mapknitter'
- DB_NAME='mapknitter'
jobs:
include:
- name: "Models Tests"
script: bundle exec rails test:models
- name: "Integration Tests"
script: bundle exec rails test:integration
- name: "Controllers Tests"
script: bundle exec rails test:controllers
- name: "System Tests"
script: bundle exec rails test:system
- name: "Rubocop Linter"
script: bundle exec rubocop
- name: "Docker Builds"
script: docker build -t mapknitter .
- name: "Asset Precompilation"
env:
- RAILS_ENV=production
script:
- bundle exec rails assets:precompile
branches:
only:
- main
- unstable
- development