Skip to content

Commit

Permalink
fix: ci actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Oct 17, 2024
1 parent 3703bc6 commit 8ba6549
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ jobs:
if: matrix.test-type == 'e2e'
run: |
pnpm exec playwright install --with-deps chromium
xvfb-run --auto-servernum -- pnpm test:e2e -- --headed
pnpm test:e2e
- name: Run E2E CRX Lock Tests
if: matrix.test-type == 'e2e-crx-lock'
run: |
pnpm exec playwright install --with-deps chromium
xvfb-run --auto-servernum -- pnpm test:e2e:crx-lock -- --headed
pnpm test:e2e:crx-lock
- uses: actions/upload-artifact@v4
if: always() && matrix.test-type != 'jest'
Expand Down
4 changes: 2 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dev:storybook": "storybook dev -p 6006",
"preview": "vite preview",
"test": "jest",
"test:e2e": "playwright test --config=playwright.config.ts",
"test:e2e:crx-lock": "playwright test --config=playwright.crx-lock.config.ts",
"test:e2e": "../../scripts/playwright.sh playwright test --config=playwright.config.ts",
"test:e2e:crx-lock": "../../scripts/playwright.sh playwright test --config=playwright.crx-lock.config.ts",
"test:ci": "pnpm ts:check && pnpm test",
"test:watch": "jest --watch",
"ts:check": "pnpm xstate:typegen && tsc --noEmit",
Expand Down
12 changes: 12 additions & 0 deletions scripts/playwright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

CMD=$1

# Check if CI environment variable is set to true
if [ "$CI" = "true" ]; then
pnpm exec playwright install --with-deps chromium
xvfb-run --auto-servernum -- $CMD
else
# Run Playwright tests normally in non-CI environment
($CMD)
fi

0 comments on commit 8ba6549

Please sign in to comment.