-
Notifications
You must be signed in to change notification settings - Fork 147
61 lines (57 loc) · 1.62 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
name: Ruby
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb
env:
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: password
options: >-
--health-cmd "mariadb-admin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Setup chromedriver
uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: '115.0.5790.110'
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Initialize stock configuration
run: bundle exec rake foodsoft:setup:stock_config
- name: Load database schema
run: bundle exec rake db:schema:load
env:
DATABASE_URL: mysql2://user:password@127.0.0.1/test
RAILS_ENV: test
- name: Run tests
run: bundle exec rake rspec-rerun:spec
env:
COVERAGE: lcov
DATABASE_URL: mysql2://user:password@127.0.0.1/test
RAILS_ENV: test
- name: Upload coverage report to Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}