Skip to content

Let setup-ruby action handle bundle install #207

Let setup-ruby action handle bundle install

Let setup-ruby action handle bundle install #207

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.

Check failure on line 1 in .github/workflows/ruby.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ruby.yml

Invalid workflow file

(Line: 83, Col: 9): Unexpected value 'healthcheck'
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Ruby
on: [pull_request]
env:
TESTOPTS: --verbose
jobs:
rubocop:
runs-on: ubuntu-latest
outputs:
ruby_version: ${{ steps.ruby_version.outputs.versions }}
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop
- id: ruby_version
uses: voxpupuli/ruby-version@v1
test:
runs-on: ubuntu-latest
needs: rubocop
strategy:
fail-fast: false
matrix:
ruby_version: ${{ fromJSON(needs.rubocop.outputs.ruby_version) }}
concurrent_ruby_ext:
- 'true'
- 'false'
db:
- postgresql
- mysql
- sqlite3
exclude:
- db: mysql
ruby_version: '3.0'
- db: mysql
ruby_version: '3.2'
- db: mysql
ruby_version: '3.4'
- db: mysql
concurrent_ruby_ext: 'true'
- db: sqlite3
ruby_version: '3.0'
- db: sqlite3
ruby_version: '3.2'
- db: sqlite3
ruby_version: '3.4'
- db: sqlite3
concurrent_ruby_ext: 'true'
- db: postgresql
ruby_version: '3.0'
concurrent_ruby_ext: 'true'
- db: postgresql
ruby_version: '3.2'
concurrent_ruby_ext: 'true'
- db: postgresql
ruby_version: '3.4'
concurrent_ruby_ext: 'true'
services:
postgres:
image: postgres:12.1
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_DB: travis_ci_test
mariadb:
image: mariadb:10
ports: ['3306:3306']
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
start_period: 1m
start_interval: 10s
interval: 1m
timeout: 5s
retries: 3
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: travis_ci_test
redis:
image: redis:latest
ports: ['6379:6379']
env:
DB: ${{ matrix.db }}
CONCURRENT_RUBY_EXT: "${{ matrix.concurrent_ruby_ext }}"
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test
- name: Upload logs
uses: actions/upload-artifact@v4
if: ${{ failure() && contains(matrix.task, 'test') }}
with:
name: logs-${{ env.ARTIFACT_SUFFIX }}
path: test.log
retention-days: 5