From 2358ef9097b06f1a0ddc9d649a6d5658f965deb0 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sun, 15 Mar 2026 21:19:03 +0200 Subject: [PATCH 1/2] fix(ci): build shared packages before OpenAPI generation The server depends on @bigcapital/email-components and other shared packages. Build them before running openapi:export to fix module resolution errors. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/generate-openapi.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/generate-openapi.yml b/.github/workflows/generate-openapi.yml index e9887a8c6..fc2790f89 100644 --- a/.github/workflows/generate-openapi.yml +++ b/.github/workflows/generate-openapi.yml @@ -43,6 +43,9 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Build shared packages + run: pnpm run build --scope "@bigcapital/utils" --scope "@bigcapital/email-components" --scope "@bigcapital/pdf-templates" + - name: Generate OpenAPI spec and SDK types run: pnpm run generate:sdk-types From be614889528b14ee2d0a6451928a34a03f15c1ba Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sun, 15 Mar 2026 21:27:24 +0200 Subject: [PATCH 2/2] 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