From 0b8a51f873463719ece8f15783cfbb98ce674cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20de=20la=20Martini=C3=A8re?= Date: Tue, 28 Jul 2020 18:24:09 +0200 Subject: [PATCH] Decouple jest-puppeteer config and test apps build --- .github/workflows/ci.yml | 11 ++++++++++- jest-puppeteer.config.js | 12 ++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72c118b..fb0f20f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,15 +24,24 @@ jobs: run: bash .github/workflows/setup_puppeteer.sh if: startsWith(matrix.os,'ubuntu') - - name: Install tests apps dependencies + - name: Install tests apps dependencies (basic) run: npm ci --prefix=src/__tests__/__apps__/basic + - name: Build test app (basic) + run: npm run build --prefix=src/__tests__/__apps__/basic + - name: Install tests apps dependencies (webpack 5) run: yarn --frozen-lockfile --cwd src/__tests__/__apps__/webpack-5 + - name: Build test app (yarn workspaces) + run: yarn --cwd src/__tests__/__apps__/webpack-5 run build + - name: Install tests apps dependencies (yarn workspaces) run: yarn --frozen-lockfile --cwd src/__tests__/__apps__/yarn-workspaces + - name: Build test app (yarn workspaces) + run: yarn --cwd src/__tests__/__apps__/yarn-workspaces/app run build + - name: 'Test: unit & end-to-end tests' run: npm test diff --git a/jest-puppeteer.config.js b/jest-puppeteer.config.js index 5b318ef..5acca85 100644 --- a/jest-puppeteer.config.js +++ b/jest-puppeteer.config.js @@ -10,18 +10,18 @@ module.exports = { }, server: [ { - command: `npm run build --prefix=${basicAppPath} && npm run start --prefix=${basicAppPath}`, - launchTimeout: 300000, + command: `npm run start --prefix=${basicAppPath}`, + launchTimeout: 20000, port: 3000 }, { - command: `yarn --cwd ${yarnWorkspacesAppPath} run build && yarn --cwd ${yarnWorkspacesAppPath} run start -- --port 3001`, - launchTimeout: 300000, + command: `yarn --cwd ${yarnWorkspacesAppPath} run start -- --port 3001`, + launchTimeout: 20000, port: 3001 }, { - command: `yarn --cwd ${webpack5AppPath} run build && yarn --cwd ${webpack5AppPath} run start -- --port 3002`, - launchTimeout: 300000, // Apparently, building is heck slow on Webpack 5 :shrug: + command: `yarn --cwd ${webpack5AppPath} run start -- --port 3002`, + launchTimeout: 20000, port: 3002 } ]