Skip to content

Try again fixing puma reporting to appsignal by loading credentials earlier, but also fix module requires #35339

Try again fixing puma reporting to appsignal by loading credentials earlier, but also fix module requires

Try again fixing puma reporting to appsignal by loading credentials earlier, but also fix module requires #35339

Workflow file for this run

name: CI
on:
pull_request:
merge_group:
push:
branches:
- main
jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poppler
run: |
sudo apt-get update
sudo apt -y install libpoppler-glib-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run Rubocop
run: bundle exec rubocop
suggest_lint_changes:
name: 'Suggest lint changes'
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poppler
run: |
sudo apt-get update
sudo apt -y install libpoppler-glib-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: Install Yarn
run: yarn install
- name: Run Lint
run: bin/lint -c
- name: Comment suggested changes
uses: parkerbxyz/[email protected]
erblint:
name: 'ERB Lint'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poppler
run: |
sudo apt-get update
sudo apt -y install libpoppler-glib-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run erb_lint
run: bundle exec erb_lint app/views/
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: package.json
- run: yarn install
- name: Run ESLint
run: yarn lint
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: package.json
- run: yarn install
- name: Run Prettier
run: yarn format:check
rspec:
name: RSpec
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
# https://docs.github.com/en/actions/tutorials/use-containerized-services/create-redis-service-containers
redis:
image: redis:latest
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poppler
run: |
sudo apt-get update
sudo apt -y install libpoppler-glib-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: Find yarn cache location
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: JS package cache
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install JS packages
run: |
yarn install --pure-lockfile
- name: Install postgres client
run: sudo apt-get install libpq-dev
- name: Build App
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/bank_test
RAILS_ENV: test
run: bundler exec rails db:create db:schema:load RAILS_ENV=test
- name: Build Assets
run: yarn build && yarn build:css
- name: Run RSpec
env:
${{ insert }}: ${{ secrets }}
DATABASE_URL: postgres://postgres:postgres@localhost:5432/bank_test
REDIS_URL: redis://localhost:6379
RAILS_ENV: test
CC_TEST_REPORTER_ID: '1' # Force SimpleCov to generate a JSON report
run: bundle exec rspec --tag ~skip
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: simplecov-report
path: coverage/coverage.json
annotate:
name: Annotate
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Poppler
run: |
sudo apt-get update
sudo apt -y install libpoppler-glib-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install postgres client
run: sudo apt-get install libpq-dev
- name: Build App
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/bank_test
RAILS_ENV: test
run: bundler exec rails db:create db:schema:load RAILS_ENV=test
- name: Run annotaterb
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/bank_test
RAILS_ENV: test
run: bundle exec annotaterb --frozen
zeitwerk:
name: Zeitwerk
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poppler
run: |
sudo apt-get update
sudo apt -y install libpoppler-glib-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: Find yarn cache location
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: JS package cache
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install JS packages
run: |
yarn install --pure-lockfile
- name: Run zeitwerk:check
env:
RAILS_ENV: test
run: bundle exec rails zeitwerk:check
brakeman:
name: Brakeman
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poppler
run: |
sudo apt-get update
sudo apt -y install libpoppler-glib-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run Brakeman
run: bundle exec brakeman -q