From f477698d1f162f991f128191c8d00e2ad7adf17b Mon Sep 17 00:00:00 2001 From: Daniel Izdebski Date: Thu, 5 Oct 2023 16:05:56 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20chore(ci):=20Run=20E2E=20tests?= =?UTF-8?q?=20on=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 32 ++++++++++++++++++++++++++++++-- package.json | 3 ++- turbo.json | 7 ++++++- 3 files changed, 38 insertions(+), 4 deletions(-) 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"] + } } }