-
Notifications
You must be signed in to change notification settings - Fork 10
76 lines (64 loc) · 1.98 KB
/
ruby.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
76
name: Ruby
env:
TZ: Europe/London
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
env:
RAILS_ENV: test
services:
mysql:
# Use the Mysql docker image https://hub.docker.com/_/mysql
image: mysql:8.0
ports:
- 3306 # Default port mappings
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_ROOT_PASSWORD: ''
MYSQL_DATABASE: labwhere_test
steps:
- uses: actions/checkout@v2
- name: Export node version
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ steps.node_version.outputs.NODE_VERSION }}
- run: yarn
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml
# example if you need more control over bundler.
- name: Set up environment
env:
DBPORT: ${{ job.services.mysql.ports[3306] }}
run: |
cp config/database.yml.example config/database.yml
cp config/secrets.yml.example config/secrets.yml
cp config/bunny.yml.example config/bunny.yml
bundle exec rails db:setup
bundle exec rails about
bundle exec rails stats
- name: Run tests
env:
DBPORT: ${{ job.services.mysql.ports[3306] }}
run: bundle exec rake
lint:
runs-on: ubuntu-latest
env:
RAILS_ENV: test
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml
# example if you need more control over bundler.
- name: Run rubocop
run: bundle exec rubocop -c .rubocop.yml --fail-fast