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:
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/. - MongoDB 7 service.
- Env:
RAILS_ENV=test,MONGODB_URI=mongodb://localhost:27017/brand_protect_test,INTERNAL_API_TOKEN=dev-secret-token. - System packages:
libvips. ruby/setup-ruby@v1withbundler-cache: true.- Runs
bin/rails db:mongoid:create_indexesthenbin/rails test.
e2e-scan
Section titled “e2e-scan”-
MongoDB + Redis services.
-
Env:
RAILS_ENV=development,MONGODB_URI=mongodb://localhost:27017/brand_protect_development,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:
libvips. -
bin/rails db:setup. -
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.