2023-09-01 02:43:13 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
2021-12-04 08:20:16 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-03-30 15:46:58 +00:00
|
|
|
services:
|
|
|
|
mariadb:
|
2023-09-01 02:37:11 +00:00
|
|
|
image: mariadb:10.6
|
2022-03-30 15:46:58 +00:00
|
|
|
env:
|
|
|
|
MARIADB_ROOT_PASSWORD: root
|
|
|
|
MARIADB_DATABASE: lobsters_dev
|
|
|
|
ports:
|
|
|
|
- 3306:3306
|
|
|
|
|
2021-12-04 08:20:16 +00:00
|
|
|
env:
|
2022-03-30 15:46:58 +00:00
|
|
|
DATABASE_URL: mysql2://root:root@127.0.0.1/lobsters_dev
|
2021-12-04 08:20:16 +00:00
|
|
|
RAILS_ENV: test
|
|
|
|
|
|
|
|
steps:
|
2023-09-01 02:37:11 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-12-04 08:20:16 +00:00
|
|
|
- uses: ruby/setup-ruby@v1
|
|
|
|
with:
|
|
|
|
bundler-cache: true
|
2023-12-06 15:21:26 +00:00
|
|
|
- name: Load database schema
|
|
|
|
run: ./bin/rails db:schema:load
|
|
|
|
- name: Run pending migrations
|
|
|
|
run: ./bin/rails db:migrate
|
2021-12-04 08:20:16 +00:00
|
|
|
- name: Run tests
|
2022-06-01 10:57:18 +00:00
|
|
|
run: |
|
|
|
|
bundle exec rspec
|
|
|
|
bundle exec rspec spec/slow/*_spec.rb
|
2021-12-04 08:20:16 +00:00
|
|
|
- name: Run linters
|
|
|
|
run: |
|
|
|
|
bundle exec standardrb
|
2023-12-18 02:22:47 +00:00
|
|
|
- name: Run brakeman
|
|
|
|
run: |
|
|
|
|
bundle exec brakeman --ensure-latest --ensure-ignore-notes
|
2021-12-04 08:20:16 +00:00
|
|
|
- name: Find leaky gems
|
|
|
|
run: |
|
|
|
|
gem install bundler-leak
|
|
|
|
bundle leak update
|
|
|
|
bundle leak check
|