diff --git a/.github/workflows/ui_tests.yml b/.github/workflows/ui_tests.yml index de3d6693c4..bdc50085ed 100644 --- a/.github/workflows/ui_tests.yml +++ b/.github/workflows/ui_tests.yml @@ -33,17 +33,29 @@ jobs: node-version: 18.x cache: 'npm' cache-dependency-path: 'package-lock.json' + - name: Get installed Playwright version + id: playwright-version + run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['apps/laboratory']['devDependencies']['@playwright/test'])")" >> $GITHUB_ENV + - name: Cache playwright binaries + uses: actions/cache@v3 + id: playwright-cache + with: + path: | + ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} - name: install run: npm ci - name: build run: npm run build - name: Install Playwright Browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' working-directory: ./apps/laboratory/ run: npm run playwright:install - name: Run Playwright tests env: NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }} NEXTAUTH_SECRET: ${{ secrets.TESTS_NEXTAUTH_SECRET }} + CI: true working-directory: ./apps/laboratory/ run: npm run playwright:test - uses: actions/upload-artifact@v3