rating/.github/workflows/tests.yml

86 lines
1.9 KiB
YAML
Raw Normal View History

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-04-21 23:44:05 +00:00
db:
- mysql
- postgres
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
2022-04-21 23:44:05 +00:00
postgres:
image: postgres
env:
POSTGRES_DB: rating_user
POSTGRES_USER: rating_user
POSTGRES_PASSWORD: rating_password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
2022-04-21 22:57:48 +00:00
2022-04-21 23:44:05 +00:00
env:
DB: ${{ matrix.db }}
POSTGRES_USER: rating_user
POSTGRES_PASSWORD: rating_password
2022-04-21 22:57:48 +00:00
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