Skip to content

feat(mega-dashboard): leave sticky streak stickers out of the shop st… #4160

feat(mega-dashboard): leave sticky streak stickers out of the shop st…

feat(mega-dashboard): leave sticky streak stickers out of the shop st… #4160

Workflow file for this run

name: CI
on:
push:
branches: [main, platform]
pull_request:
merge_group:
permissions:
contents: read
env:
BUNDLE_WITHOUT: development
jobs:
checks:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- name: Brakeman
system_packages: "libblas-dev liblapack-dev"
command: bin/brakeman --no-pager
- name: RuboCop
system_packages: "libblas-dev liblapack-dev"
command: bin/rubocop -f github
- name: ERB Lint
system_packages: "libblas-dev liblapack-dev"
command: bundle exec erb_lint --lint-all
- name: Prettier JS/TS
skip_ruby: true
needs_node: true
command: yarn prettier --check "app/javascript/**/*.{js,jsx,ts,tsx}"
- name: Prettier SCSS/CSS
skip_ruby: true
needs_node: true
command: yarn prettier --check "app/assets/stylesheets/**/*.{scss,css}"
- name: Zeitwerk
system_packages: "libvips-dev libblas-dev liblapack-dev"
rails_env: test
command: bin/rails zeitwerk:check
name: ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install system dependencies
if: matrix.system_packages
timeout-minutes: 10
env:
DEBIAN_FRONTEND: noninteractive
run: bash .github/scripts/apt-install.sh ${{ matrix.system_packages }}
- name: Set up Ruby
if: ${{ !matrix.skip_ruby }}
uses: ruby/setup-ruby@v1.321.0
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Set up Node.js
if: matrix.needs_node
uses: actions/setup-node@v7
with:
node-version-file: package.json
- name: Enable Corepack
if: matrix.needs_node
run: corepack enable
- name: Install JS dependencies
if: matrix.needs_node
run: yarn install --immutable
- name: Run check
env:
RAILS_ENV: ${{ matrix.rails_env || '' }}
run: ${{ matrix.command }}
db_checks:
runs-on: ubuntu-latest
timeout-minutes: 15
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: stardance_test
ports:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
env:
RAILS_ENV: test
DATABASE_URL: postgresql://postgres:password@localhost:5432/stardance_test
steps:
- uses: actions/checkout@v7
- name: Install system dependencies
timeout-minutes: 10
env:
DEBIAN_FRONTEND: noninteractive
run: bash .github/scripts/apt-install.sh libvips-dev libblas-dev liblapack-dev
- uses: ruby/setup-ruby@v1.321.0
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Check schema matches migrations
run: |
bundle exec rails db:migrate
if ! git diff --exit-code db/schema.rb; then
echo "### :rage2: you GOOF!" >> $GITHUB_STEP_SUMMARY
echo "Schema dump has fallen out of date." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo 'Run `rails db:migrate` locally and commit the changes to `db/schema.rb`.' >> $GITHUB_STEP_SUMMARY
exit 1
fi
- name: Check annotations are up to date
run: |
if ! bundle exec annotaterb models --frozen; then
echo "### :rage1: you SILLY GOOSE!" >> $GITHUB_STEP_SUMMARY
echo "Model annotations have fallen out of date." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo 'Run `bundle exec annotaterb models` locally and commit the changes.' >> $GITHUB_STEP_SUMMARY
exit 1
fi