CI/CD
CI lives in .github/workflows/ci.yml and runs on every pull request and push to main. It has three jobs.
python-tests
Section titled “python-tests”- Working directory:
services/. - Installs system packages for WeasyPrint/pango and Postgres:
libpq-dev libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz0b libffi-dev libcairo2 libgdk-pixbuf-2.0-0. actions/setup-python@v5with Python 3.14 and pip caching keyed onservices/requirements.txt.- Installs
pip install -r requirements.txt pytest-asyncio. - Runs
python -m pytest -p no:cacheprovider.
rails-tests
Section titled “rails-tests”- Working directory:
rails_web/. - Postgres 16 service (DB:
brand_protect_test). - Env:
RAILS_ENV=test,DATABASE_URL,INTERNAL_API_TOKEN=dev-secret-token. - System packages:
libpq-dev libvips. ruby/setup-ruby@v1withbundler-cache: true.- Runs
bin/rails db:test:preparethenbin/rails test.
e2e-scan
Section titled “e2e-scan”-
Postgres + Redis services.
-
Env:
RAILS_ENV=development,DATABASE_URL,REDIS_URL=redis://localhost:6379/1,INTERNAL_API_TOKEN=dev-secret-token,RAILS_API_URL=http://localhost:3000,PYTHON_API_URL=http://localhost:8000/api/v1. -
System packages:
libpq-dev libvips. -
bin/rails db:prepare. -
Starts both servers in the background:
rails_web/ nohup bin/rails server -p 3000 > /tmp/rails.log 2>&1 &# services/src/nohup uvicorn main:app --host 0.0.0.0 --port 8000 > /tmp/python.log 2>&1 & -
Runs
python e2e/scan_e2e_test.py. -
On failure, uploads both logs (
/tmp/rails.log,/tmp/python.log) as artifacts.