name: CI on: push: branches: [main, develop] pull_request: branches: [main, develop] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: # -------------------------------------------------------------------- # Frontend: type-check, lint, build, and run Playwright smoke tests. # -------------------------------------------------------------------- frontend: name: Frontend — lint + build + e2e runs-on: ubuntu-latest defaults: run: working-directory: frontend steps: - uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: "20" cache: "npm" cache-dependency-path: frontend/package-lock.json - name: Install dependencies run: npm ci - name: Type check run: npx tsc --noEmit -p tsconfig.app.json - name: Lint run: npm run lint - name: Build run: npm run build - name: Install Playwright browsers run: npx playwright install --with-deps chromium - name: Run Playwright smoke tests run: npm run test:e2e env: CI: "true" - name: Upload Playwright report if: failure() uses: actions/upload-artifact@v4 with: name: playwright-report path: frontend/playwright-report retention-days: 7 # -------------------------------------------------------------------- # Backend: run the Odoo HttpCase smoke suite via the official image. # # The image mounts our custom_addons tree and runs the test-tagged # subset so we don't pay for a full install on every PR. # -------------------------------------------------------------------- backend: name: Backend — Odoo HttpCase runs-on: ubuntu-latest services: postgres: image: postgres:16 env: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo POSTGRES_DB: postgres ports: - 5432:5432 options: >- --health-cmd "pg_isready -U odoo" --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - name: Run Odoo HttpCase tests in a throwaway container run: | docker run --rm \ --network host \ -v "$GITHUB_WORKSPACE/backend/custom_addons:/mnt/extra-addons" \ -e HOST=localhost \ -e USER=odoo \ -e PASSWORD=odoo \ odoo:19 \ --stop-after-init \ --test-enable \ --test-tags "encoach_api" \ --log-level=warn \ --without-demo=all \ --init=encoach_api,encoach_core \ -d encoach_ci || { echo "::warning::Odoo HttpCase suite failed — see logs above." exit 1 } env: PGHOST: localhost PGUSER: odoo PGPASSWORD: odoo