ci: add ci workflow #4
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
push: | |
branches: [ main ] | |
jobs: | |
scan_ruby: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
env: | |
RAILS_ENV: test | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
- name: Scan for common Rails security vulnerabilities using static analysis | |
run: bin/brakeman --no-pager | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
env: | |
RAILS_ENV: test | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
- name: Lint code for consistent style | |
run: bin/rubocop -f github | |
rspec_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
- name: Run rspec | |
env: | |
RAILS_ENV: test | |
run: bundle exec rspec |