From a8c334fa5b1acf52cd0f07a6630545934d274180 Mon Sep 17 00:00:00 2001 From: Tim Shamilov Date: Sat, 2 Dec 2023 22:18:16 -0500 Subject: [PATCH] add parallelism --- .github/workflows/tests-ci.yml | 11 +++++++---- package.json | 19 +++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests-ci.yml b/.github/workflows/tests-ci.yml index 38dc1cb5f..19e1a1df7 100644 --- a/.github/workflows/tests-ci.yml +++ b/.github/workflows/tests-ci.yml @@ -87,6 +87,9 @@ jobs: test-with-browsers: # Run browser tests using macOS so that WebKit tests don't fail under a Linux environment runs-on: macos-latest + strategy: + matrix: + group: ['a', 'b'] steps: - name: Checkout source uses: actions/checkout@v4 @@ -127,16 +130,16 @@ jobs: path: ~/Library/Caches/ms-playwright key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} - - name: Build browser bundles - run: npm run build build:browser --ws + - name: Build browser bundles for matrix ${{ matrix.group }}) + run: npm run ci:build:browser:matrix:${{ matrix.group }} - name: Run dwn-server (background) run: | node node_modules/@web5/dwn-server/dist/esm/src/main.js & echo "DWN_SERVER_BACKGROUND_PROCESS=$!" >> $GITHUB_ENV - - name: Run tests for all packages - run: npm run test:browser --ws + - name: Run tests for matrix ${{ matrix.group }} + run: npm run ci:test:browser:matrix:${{ matrix.group }} - name: Terminate dwn-server run: kill $DWN_SERVER_BACKGROUND_PROCESS || true diff --git a/package.json b/package.json index 15be255c1..74e07440d 100644 --- a/package.json +++ b/package.json @@ -3,19 +3,26 @@ "private": true, "type": "module", "workspaces": [ + "packages/agent", + "packages/api", "packages/common", + "packages/credentials", "packages/crypto", "packages/dids", - "packages/credentials", - "packages/agent", - "packages/user-agent", + "packages/identity-agent", "packages/proxy-agent", - "packages/api", - "packages/identity-agent" + "packages/user-agent" ], "scripts": { "clean": "npx npkill -d $(pwd) -t node_modules && npx npkill -d $(pwd)/packages -t dist", - "build": "npm run build --ws" + "build": "npm run build --ws", + "test:browser": "npm run test:browser --ws", + "test:node": "npm run test:node --ws", + "dwn-server":"node node_modules/@web5/dwn-server/dist/esm/src/main.js || true", + "ci:build:browser:matrix:a": "npm run build:browser --workspace packages/agent", + "ci:build:browser:matrix:b": "npm run build:browser --workspace packages/api --workspace packages/common --workspace packages/credentials --workspace packages/crypto --workspace packages/dids --workspace packages/identity-agent --workspace packages/proxy-agent --workspace packages/user-agent", + "ci:test:browser:matrix:a": "npm run test:browser --workspace packages/agent", + "ci:test:browser:matrix:b": "npm run test:browser --workspace packages/api --workspace packages/common --workspace packages/credentials --workspace packages/crypto --workspace packages/dids --workspace packages/identity-agent --workspace packages/proxy-agent --workspace packages/user-agent" }, "repository": { "type": "git",