Skip to content

Provide the DATABASE_URL env var in CI #3

Provide the DATABASE_URL env var in CI

Provide the DATABASE_URL env var in CI #3

Workflow file for this run

---
name: CI
on:
pull_request:
push:
branches:
- master
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
jobs:
test:
name: "Test"
runs-on: ubuntu-latest
services:
db:
image: postgres:latest
ports: ["5432:5432"]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec rails db:prepare
- run: bundle exec rspec
rubocop:
name: "Lint / rubocop"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bin/rubocop
brakeman:
name: "Security / brakeman"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec brakeman --exit-on-warn --no-progress --color --output /dev/stdout
bundle-audit:
name: "Security / bundle-audit"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec bundle-audit check --update -v