From be614889528b14ee2d0a6451928a34a03f15c1ba Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sun, 15 Mar 2026 21:27:24 +0200 Subject: [PATCH] fix(ci): add MySQL and Redis services for OpenAPI generation The NestJS app requires database and Redis connections to bootstrap. Added GitHub Actions services for MySQL and Redis with necessary environment variables for the openapi:export command to work. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/generate-openapi.yml | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/.github/workflows/generate-openapi.yml b/.github/workflows/generate-openapi.yml index fc2790f89..7b5dc2066 100644 --- a/.github/workflows/generate-openapi.yml +++ b/.github/workflows/generate-openapi.yml @@ -16,12 +16,80 @@ defaults: run: shell: 'bash' +env: + # Database configuration + DB_HOST: 127.0.0.1 + DB_USER: root + DB_PASSWORD: root + DB_CHARSET: utf8 + SYSTEM_DB_NAME: bigcapital_system + TENANT_DB_NAME_PERFIX: bigcapital_tenant_ + # Redis configuration + REDIS_HOST: 127.0.0.1 + REDIS_PORT: 6379 + # Queue configuration + QUEUE_HOST: 127.0.0.1 + QUEUE_PORT: 6379 + # App configuration + APP_JWT_SECRET: test-jwt-secret-for-openapi-generation + JWT_SECRET: test-jwt-secret-for-openapi-generation + BASE_URL: http://localhost:3000 + # Feature flags + SIGNUP_DISABLED: 'false' + SIGNUP_EMAIL_CONFIRMATION: 'false' + API_RATE_LIMIT: 120,60,600 + # Optional services (empty for OpenAPI generation) + MAIL_HOST: '' + MAIL_PORT: '' + MAIL_USERNAME: '' + MAIL_PASSWORD: '' + MAIL_FROM_NAME: '' + MAIL_FROM_ADDRESS: '' + GOTENBERG_URL: '' + GOTENBERG_DOCS_URL: '' + PLAID_CLIENT_ID: '' + PLAID_SECRET: '' + LEMONSQUEEZY_API_KEY: '' + S3_ACCESS_KEY_ID: '' + S3_SECRET_ACCESS_KEY: '' + S3_BUCKET: '' + POSTHOG_API_KEY: '' + STRIPE_PAYMENT_SECRET_KEY: '' + OPEN_EXCHANGE_RATE_APP_ID: '' + BULLBOARD_ENABLED: 'false' + BULLBOARD_USERNAME: '' + BULLBOARD_PASSWORD: '' + jobs: generate-openapi: name: Generate OpenAPI and SDK Types runs-on: ubuntu-latest timeout-minutes: 15 + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: bigcapital_system + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping --silent" + --health-interval=10s + --health-timeout=5s + --health-retries=10 + + redis: + image: redis:7-alpine + ports: + - 6379:6379 + options: >- + --health-cmd="redis-cli ping" + --health-interval=10s + --health-timeout=5s + --health-retries=10 + steps: - name: Checkout code uses: actions/checkout@v4