Container name added to facilitate cleanup #411
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: Main | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
env: | |
RAILS_ENV: test | |
NODE_ENV: test | |
DB_PORT: 33306 | |
DB_USER: root | |
DB_PASSWORD: root | |
jobs: | |
rubocop: | |
name: RuboCop | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "16.19.0" | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.1 | |
bundler-cache: true | |
- name: Run eslint | |
run: | | |
./bin/yarn install | |
./bin/yarn lint | |
- name: Run rubocop | |
run: | | |
bundle exec rubocop | |
rspec: | |
name: RSpec | |
runs-on: ubuntu-20.04 | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }} | |
ports: | |
- 33306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "16.19.0" | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.1 | |
bundler-cache: true | |
- name: Setup database | |
run: | | |
cp config/database.github-actions.yml config/database.yml | |
cp config/server.yml.example config/server.yml | |
sudo systemctl start mysql | |
bundle exec rails db:create db:schema:load | |
- name: Run rspec | |
run: | | |
./bin/yarn install | |
./bin/rails test:prepare | |
bundle exec rspec spec --tag ~pending --order rand | |
migrations: | |
name: Migrations | |
runs-on: ubuntu-20.04 | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }} | |
ports: | |
- 33306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.1 | |
bundler-cache: true | |
- name: Setup database | |
run: | | |
cp config/database.github-actions.yml config/database.yml | |
cp config/server.yml.example config/server.yml | |
sudo systemctl start mysql | |
- name: Run migrations (up) | |
run: | | |
RAILS_ENV=development ./spec/migrations/test_migrations_up |