74 lines
1.6 KiB
YAML
74 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
name: Lint & Test
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:17.5
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_DB: starter_test
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd="pg_isready -U postgres"
|
|
--health-interval=5s
|
|
--health-timeout=5s
|
|
--health-retries=5
|
|
|
|
redis:
|
|
image: redis:8.4-alpine
|
|
ports:
|
|
- 6379:6379
|
|
options: >-
|
|
--health-cmd="redis-cli ping"
|
|
--health-interval=5s
|
|
--health-timeout=5s
|
|
--health-retries=5
|
|
|
|
env:
|
|
RAILS_ENV: test
|
|
DB_HOST: localhost
|
|
DB_PASS: password
|
|
DB_USER: postgres
|
|
DB_DIRECT_HOST: localhost
|
|
DB_DIRECT_PORT: "5432"
|
|
REDIS_URL: redis://localhost:6379/1
|
|
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: "4.0.1"
|
|
bundler-cache: true
|
|
|
|
- name: Install Chromium
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y --no-install-recommends chromium-browser chromium-chromedriver
|
|
|
|
- name: Prepare database
|
|
run: |
|
|
bin/rails db:prepare
|
|
bin/rails parallel:prepare
|
|
|
|
- name: Run check-fast
|
|
run: bin/check-fast
|