2022-05-18 01:13:06 +00:00
|
|
|
name: Tests
|
2022-04-21 22:57:48 +00:00
|
|
|
|
2022-05-18 01:13:06 +00:00
|
|
|
on: [push, pull_request]
|
2022-04-21 22:57:48 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2022-05-18 01:13:06 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2022-05-18 01:13:06 +00:00
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
matrix:
|
|
|
|
ruby:
|
2022-05-18 01:13:06 +00:00
|
|
|
- '2.7'
|
2022-04-21 22:57:48 +00:00
|
|
|
- '3.0'
|
|
|
|
- '3.1'
|
2022-05-18 01:13:06 +00:00
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
services:
|
|
|
|
mysql:
|
|
|
|
env:
|
|
|
|
MYSQL_DATABASE: rating_test
|
|
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
2022-05-18 01:13:06 +00:00
|
|
|
|
|
|
|
image: mysql:8
|
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
ports:
|
|
|
|
- 3306:3306
|
|
|
|
|
|
|
|
steps:
|
2022-05-18 01:13:06 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Ruby and Bundle Install
|
|
|
|
uses: ruby/setup-ruby@v1
|
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
with:
|
|
|
|
bundler-cache: true
|
2022-05-18 01:13:06 +00:00
|
|
|
ruby-version: ${{ matrix.ruby }}
|
|
|
|
|
|
|
|
- name: Runs tests
|
2022-05-18 01:48:47 +00:00
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
COVERAGE: true
|
|
|
|
MINIMUM_COVERAGE: 80
|
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
run: bundle exec rake spec
|
2022-05-18 01:13:06 +00:00
|
|
|
|
|
|
|
- name: Runs tests with config enabled
|
2022-05-18 01:48:47 +00:00
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
COVERAGE: true
|
|
|
|
MINIMUM_COVERAGE: 80
|
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
run: bundle exec rake spec_config
|
2022-05-18 01:13:06 +00:00
|
|
|
|
|
|
|
- name: Runs tests with config enabled for extra scopes
|
2022-05-18 01:48:47 +00:00
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
COVERAGE: true
|
|
|
|
MINIMUM_COVERAGE: 80
|
|
|
|
|
2022-04-21 22:57:48 +00:00
|
|
|
run: bundle exec rake spec_config_with_extra_scopes
|