From 3e5b135ceb178bbedefd56aabd7da34334b1f867 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Sun, 5 Feb 2023 18:56:50 +0800 Subject: [PATCH] chore: split e2e & unit test --- .github/workflows/tests.yml | 40 +++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e288457c1c..a351e80296 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,17 +5,13 @@ on: pull_request: branches: [master] jobs: - test: + e2e-test: timeout-minutes: 60 - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 'latest' - - uses: actions/setup-node@v3 with: node-version: 16 @@ -23,6 +19,10 @@ jobs: scope: '@toeverything' cache: 'pnpm' + - uses: pnpm/action-setup@v2 + with: + version: 'latest' + - run: node scripts/module-resolve/ci.cjs - name: Install dependencies @@ -53,5 +53,33 @@ jobs: name: affine fail_ci_if_error: true + unit-test: + timeout-minutes: 60 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://npm.pkg.github.com + scope: '@toeverything' + cache: 'pnpm' + + - uses: pnpm/action-setup@v2 + with: + version: 'latest' + + - run: node scripts/module-resolve/ci.cjs + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_AUTH_TOKEN }} + + - name: Install Playwright browsers + run: npx playwright install chromium + - name: Run Unit tests run: pnpm run test:unit