Skip to content

Hack an experiment at responsive design for mobile application alerts #522

Hack an experiment at responsive design for mobile application alerts

Hack an experiment at responsive design for mobile application alerts #522

Workflow file for this run

# This workflow uses actions that are not certified by GitHub. They are
# provided by a third-party and are governed by separate terms of service,
# privacy policy, and support documentation.
#
# This workflow will install a prebuilt Ruby version, install dependencies, and
# run tests and linters.
name: "Ruby on Rails CI"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
test:
runs-on: ubuntu-latest
services:
# We're using postgres 15.2 in production currently
postgres:
image: postgis/postgis:15-3.3
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: "postgis://postgres:postgres@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v3
# Add or replace dependency steps here
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
# Add or replace database setup steps here
- name: Create database
run: bin/rails db:create
- name: Set up database schema
run: bin/rails db:schema:load
# Add or replace test runners here
- name: Run tests
run: bin/rake
type_check:
runs-on: ubuntu-latest
services:
# We're using postgres 15.2 in production currently
postgres:
image: postgis/postgis:15-3.3
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# TODO: Don't run in test environment so we don't need --environment=test below
RAILS_ENV: test
DATABASE_URL: "postgis://postgres:postgres@localhost:5432/rails_test"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Create database
run: bin/rails db:create
- name: Set up database schema
run: bin/rails db:schema:load
- name: Sorbet type checking
run: bin/srb
- name: Verify tapioca gems up to date
run: bin/tapioca gems --verify
- name: Verify tapioca dsl up to date
run: bin/tapioca dsl --verify --environment=test
- name: Verify tapioca shims up to date
run: bin/tapioca check-shims
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Rubocop
run: bin/rubocop --parallel
- name: Lint haml
run: bin/haml-lint
- name: Lint erb
run: bin/erblint --lint-all
- name: Security audit application code
run: bin/brakeman -q -w2