Skip to content

CI setup

CI setup #2

name: Run rspec, rubocop
on:
push:
pull_request:
jobs:
rspec:
runs-on: ubuntu-latest
timeout-minutes: 10
services:
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Bundler and gem install
run: |
gem install bundler
bundle install --jobs 4 --retry 3 --path vendor/bundle
- name: Yarn install
run: yarn install --check-files
- name: Run rspec
run: bundle exec rspec
rubocop:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop