rating/.github/workflows/tests.yml

91 lines
1.8 KiB
YAML
Raw Permalink 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 13:45:14 +00:00
env:
DB: ${{ matrix.db }}
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:
2022-05-18 13:42:53 +00:00
db:
- mysql
- postgres
2022-04-21 22:57:48 +00:00
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 13:42:53 +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
2022-05-18 01:13:06 +00:00
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-05-18 13:42:53 +00:00
2022-04-21 23:44:05 +00:00
postgres:
env:
2022-05-18 13:42:53 +00:00
POSTGRES_DB: rating_test
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
2022-05-18 13:48:42 +00:00
image: postgres:alpine
2022-05-18 13:42:53 +00:00
2022-04-21 23:44:05 +00:00
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
2022-05-18 13:42:53 +00:00
2022-04-21 23:44:05 +00:00
ports:
- 5432:5432
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