Skip to content

Merge pull request #1447 from sanger/y24-320-fix-errors-with-hidden-s… #4543

Merge pull request #1447 from sanger/y24-320-fix-errors-with-hidden-s…

Merge pull request #1447 from sanger/y24-320-fix-errors-with-hidden-s… #4543

Workflow file for this run

name: Ruby
env:
TZ: Europe/London
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
# Use the Mysql docker image https://hub.docker.com/_/mysql
image: mysql:8.0
ports:
- 3306 # Default port mappings
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_ROOT_PASSWORD: ''
MYSQL_DATABASE: traction_service_test
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml
# example if you need more control over bundler.
- name: Set up environment
env:
DBPORT: ${{ job.services.mysql.ports[3306] }}
run: |
cp config/database.yml.example config/database.yml
cp config/mailer.yml.example config/mailer.yml
cp config/bunny.yml.example config/bunny.yml
bundle exec rake db:reset
- name: Run tests
env:
DBPORT: ${{ job.services.mysql.ports[3306] }}
run: bundle exec rake
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml
# example if you need more control over bundler.
- name: Run rubocop
run: bundle exec rubocop -c .rubocop.yml --fail-fast