2020-09-05 15:51:48 +02:00
|
|
|
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: >-
|
2023-06-16 13:33:21 +02:00
|
|
|
--health-cmd "mariadb-admin ping"
|
2020-09-05 15:51:48 +02:00
|
|
|
--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@v1.0.1
|
|
|
|
- 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:
|
2021-02-18 13:18:31 +01:00
|
|
|
COVERAGE: lcov
|
2020-09-05 15:51:48 +02:00
|
|
|
DATABASE_URL: mysql2://user:password@127.0.0.1/test
|
|
|
|
RAILS_ENV: test
|
2021-02-18 13:18:31 +01:00
|
|
|
- name: Upload coverage report to Coveralls
|
|
|
|
uses: coverallsapp/github-action@v1.1.2
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|