Skip to content

Add tag for Crypt Bolt Attack #10

Add tag for Crypt Bolt Attack

Add tag for Crypt Bolt Attack #10

Workflow file for this run

name: 'Ruby on Rails CI'
on:
push:
branches: ['main']
pull_request:
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
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Scan for security vulnerabilities in Ruby dependencies
run: bin/brakeman --no-pager
- name: Security audit dependencies
run: bundle exec bundle audit --update
# TODO set up workflow with yarn npm audit maybe
# scan_js:
# 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: Scan for security vulnerabilities in JavaScript dependencies
# run: bin/importmap audit
lint_ruby:
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: Lint code for consistent style
run: bin/rubocop -f github
# TODO set up workflow with eslint maybe
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
ports:
- '5432:5432'
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
env:
CI: true
RAILS_ENV: test
DATABASE_URL: 'postgres://rails:password@localhost:5432/rails_test'
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 tests
env:
RAILS_ENV: test
# REDIS_URL: redis://localhost:6379/0
run: bin/rails db:test:prepare spec
# - name: Keep screenshots from failed system tests
# uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: screenshots
# path: ${{ github.workspace }}/tmp/screenshots
# if-no-files-found: ignore