Harmonize Rack dependency and tests (#27) #140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
- pull_request | |
env: | |
BUNDLE_PATH: vendor/bundle | |
jobs: | |
lint: | |
name: Code Style | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
ruby: | |
- "2.7" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Rubocop Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/rubocop_cache | |
key: ${{ runner.os }}-rubocop-${{ hashFiles('.rubocop.yml') }} | |
restore-keys: | | |
${{ runner.os }}-rubocop- | |
- name: Standard (Lint) | |
run: bundle exec rake standard | |
test: | |
name: "Specs (Rack 2 and 3)" | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
ruby: | |
- "2.7" | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis | |
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: RSpec via Appraisal | |
run: "bundle exec appraisal install && bundle exec appraisal rspec" | |
env: | |
MYSQL_HOST: 127.0.0.1 | |
MYSQL_PORT: 3306 | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: postgres |