diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4929be44a..5e832b31f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,8 +7,8 @@ on: pull_request: jobs: - test: - name: Run tests + test-unit: + name: Run unit tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -31,3 +31,31 @@ jobs: - name: Run tests run: pnpm run test + + test-e2e: + name: Run E2E tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2 + with: + version: 8.7.6 + + - uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + registry-url: https://registry.npmjs.org + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Install browsers for Playwright + run: pnpm dlx playwright install + + - name: Build project + run: pnpm run build + + - name: Run E2E tests (headless) + run: pnpm run test:e2e:headless diff --git a/package.json b/package.json index c77ecbf97..4def146e9 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "prepare": "husky install", "sort-package-json": "sort-package-json 'package.json' '{packages,wallets,examples}/*/package.json'", "sort-package-json:check": "sort-package-json 'package.json' '{packages,wallets,examples}/*/package.json' --check", - "test": "turbo test" + "test": "turbo test", + "test:e2e:headless": "turbo test:e2e:headless" }, "lint-staged": { "package.json": "sort-package-json" diff --git a/turbo.json b/turbo.json index d79846eed..9292534fe 100644 --- a/turbo.json +++ b/turbo.json @@ -5,6 +5,11 @@ "dependsOn": ["^build"], "outputs": ["dist/**", "types/**"] }, - "test": {} + "test": { + "dependsOn": ["build"] + }, + "test:e2e:headless": { + "dependsOn": ["build"] + } } }