diff --git a/e2e-chatbot-app-next/.github/workflows/lint.yml b/.github/workflows/e2e-chatbot-app-next/lint.yml similarity index 58% rename from e2e-chatbot-app-next/.github/workflows/lint.yml rename to .github/workflows/e2e-chatbot-app-next/lint.yml index 91a1ce8..14d8ba6 100644 --- a/e2e-chatbot-app-next/.github/workflows/lint.yml +++ b/.github/workflows/e2e-chatbot-app-next/lint.yml @@ -1,6 +1,11 @@ -name: Lint +name: Lint (e2e-chatbot-app-next) on: push: + paths: + - 'e2e-chatbot-app-next/**' + pull_request: + paths: + - 'e2e-chatbot-app-next/**' jobs: build: @@ -15,7 +20,10 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: npm + cache-dependency-path: e2e-chatbot-app-next/package-lock.json - name: Install dependencies + working-directory: e2e-chatbot-app-next run: npm ci - name: Run lint + working-directory: e2e-chatbot-app-next run: npm run lint diff --git a/e2e-chatbot-app-next/.github/workflows/playwright.yml b/.github/workflows/e2e-chatbot-app-next/playwright.yml similarity index 73% rename from e2e-chatbot-app-next/.github/workflows/playwright.yml rename to .github/workflows/e2e-chatbot-app-next/playwright.yml index bab26bc..a8531ed 100644 --- a/e2e-chatbot-app-next/.github/workflows/playwright.yml +++ b/.github/workflows/e2e-chatbot-app-next/playwright.yml @@ -1,9 +1,13 @@ -name: Playwright Tests +name: Playwright Tests (e2e-chatbot-app-next) on: push: branches: [main, master] + paths: + - 'e2e-chatbot-app-next/**' pull_request: branches: [main, master] + paths: + - 'e2e-chatbot-app-next/**' jobs: test: @@ -25,16 +29,6 @@ jobs: --health-retries 5 env: POSTGRES_URL: postgresql://postgres:postgres@localhost:5432/chatbot?sslmode=disable - PGHOST: localhost - PGPORT: 5432 - PGDATABASE: chatbot - PGUSER: postgres - PGPASSWORD: postgres - PGSSLMODE: disable - DATABRICKS_SERVING_ENDPOINT: "mock-value" - DATABRICKS_CLIENT_ID: "mock-value" - DATABRICKS_CLIENT_SECRET: "mock-value" - DATABRICKS_HOST: "mock-value" steps: - uses: actions/checkout@v4 @@ -45,15 +39,17 @@ jobs: with: node-version: lts/* cache: npm + cache-dependency-path: e2e-chatbot-app-next/package-lock.json - uses: actions/cache@v3 with: path: ${{ steps.npm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-npm-store-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-npm-store-${{ hashFiles('e2e-chatbot-app-next/**/package-lock.json') }} restore-keys: | ${{ runner.os }}-npm-store- - name: Install dependencies + working-directory: e2e-chatbot-app-next run: npm ci - name: Cache Playwright browsers @@ -61,16 +57,18 @@ jobs: id: playwright-cache with: path: ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-playwright-${{ hashFiles('e2e-chatbot-app-next/**/package-lock.json') }} - name: Install Playwright Browsers if: steps.playwright-cache.outputs.cache-hit != 'true' run: npx playwright install --with-deps chromium - name: Run database migrations + working-directory: e2e-chatbot-app-next run: npm run db:migrate - name: Run Playwright tests + working-directory: e2e-chatbot-app-next env: PLAYWRIGHT: True run: npm run test @@ -79,5 +77,5 @@ jobs: if: always() && !cancelled() with: name: playwright-report - path: playwright-report/ + path: e2e-chatbot-app-next/playwright-report/ retention-days: 7