diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e0595d2b..ddc10d39 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,38 +18,22 @@ jobs: - 5432:5432 options: >- --health-cmd pg_isready - --health-interval 10s + --health-interval 5s --health-timeout 5s - --health-retries 5 + --health-retries 3 steps: - uses: actions/checkout@v4 - - name: Cache node modules - id: cache-npm - uses: actions/cache@v4 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - name: Cache Playwright binaries - uses: actions/cache@v4 - id: playwright-cache + - uses: actions/setup-node@v4 with: - path: ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-playwright- - - name: Install dependencies + node-version: 21 + cache: "npm" + - name: Setup application run: npm ci - - name: Install Playwright + - name: Install Playwright Browsers run: npx playwright install --with-deps chromium - - name: Start backend + - name: Start backend and frontend env: DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db JWT_SECRET: ${{ secrets.JWT_SECRET }} @@ -57,19 +41,20 @@ jobs: API_URL: http://0.0.0.0:3333 LUNARY_PUBLIC_KEY: 259d2d94-9446-478a-ae04-484de705b522 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - timeout-minutes: 1 - run: npm run migrate:db && npm run start:backend & npx wait-on http://localhost:3333/v1/health - - name: Start frontend - env: - API_URL: http://0.0.0.0:3333 NEXT_PUBLIC_API_URL: http://0.0.0.0:3333 timeout-minutes: 3 - run: (npm run dev:frontend) & npx wait-on http://0.0.0.0:8080/ + run: | + npm run migrate:db + npm run start:backend & + npm run dev:frontend & + npx wait-on http://localhost:3333/v1/health http://0.0.0.0:8080/ + - name: Run tests run: npx playwright test env: BASE_URL: http://0.0.0.0:8080 DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db + - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: diff --git a/patches/postgres+3.4.4.patch b/patches/postgres+3.4.5patch similarity index 100% rename from patches/postgres+3.4.4.patch rename to patches/postgres+3.4.5patch diff --git a/playwright.config.ts b/playwright.config.ts index 36550fac..d592325f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -43,7 +43,7 @@ export default defineConfig({ projects: [ { name: "setup", testMatch: "auth.setup.ts" }, { - // Projects tests need to be ran before all other tests to avoid project mismatches. + // Projects related tests need to be ran before all other tests to avoid project mismatches. name: "projects", testMatch: "projects.setup.ts", use: {