concurrent setup

This commit is contained in:
Elio Bischof
2024-10-16 17:11:51 +02:00
parent f1b756b721
commit c5620e6acc
2 changed files with 19 additions and 10 deletions

View File

@@ -6,17 +6,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run docker-compose
uses: hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: "./acceptance/docker-compose.yaml"
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install && pnpm generate
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Docker Compose and Install Dependencies in Parallel
run: |
echo "Start docker-compose in the background"
docker-compose -f ./acceptance/docker-compose.yaml up -d &
echo "Install node_modules in the foreground"
npm install -g pnpm && pnpm install
echo "Generate and create a production build in the background"
pnpm build &
echo "Install Playwright with browsers in the background"
pnpm exec playwright install --with-deps &
echo "Wait for all background processes to complete"
wait
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4

View File

@@ -43,11 +43,12 @@ export default defineConfig({
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
/* TODO: webkit fails. Is this a bug?
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
*/
/* Test against mobile viewports. */
// {
@@ -74,7 +75,7 @@ export default defineConfig({
webServer: {
command: 'pnpm start',
url: 'http://127.0.0.1:3000',
reuseExistingServer: !process.env.CI,
reuseExistingServer: false, //!process.env.CI,
timeout: 5 * 60_000,
},
});