From 1744801867e773ab95b8e6c21e81d886493bf064 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 22 Aug 2023 06:52:57 -0700 Subject: [PATCH 1/8] Try parallelize tests and build --- .github/workflows/ci.yml | 42 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eaf22d67..1d6c3adf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,6 @@ jobs: run: yarn lint-api unit-tests: - needs: build strategy: matrix: node-version: [16, 18] @@ -78,6 +77,15 @@ jobs: runs-on: ${{ matrix.runs-on }}-latest steps: - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }}.x + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }}.x + cache: 'yarn' + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Wait for build job + uses: NathanFirmo/wait-for-other-job@v1.1.1 - uses: actions/download-artifact@v3 with: name: build-artifacts @@ -89,18 +97,10 @@ jobs: run: 7z x compressed-build.zip -aoa -o${{ github.workspace }} - name: Print directory structure run: ls -R - - name: Use Node.js ${{ matrix.node-version }}.x - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }}.x - cache: 'yarn' - - name: Install dependencies - run: yarn --frozen-lockfile - name: Unit tests run: yarn test-unit --forbid-only integration-tests: - needs: build strategy: matrix: node-version: [18] @@ -109,17 +109,6 @@ jobs: runs-on: ${{ matrix.runs-on }}-latest steps: - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: build-artifacts - - name: Unzip artifacts (Linux, macOS) - if: runner.os != 'Windows' - run: unzip -o compressed-build.zip - - name: Unzip artifacts (Windows) - if: runner.os == 'Windows' - run: 7z x compressed-build.zip -aoa -o${{ github.workspace }} - - name: Print directory structure - run: ls -R - name: Use Node.js ${{ matrix.node-version }}.x uses: actions/setup-node@v3 with: @@ -129,5 +118,18 @@ jobs: run: yarn --frozen-lockfile - name: Install playwright run: npx playwright install + - name: Wait for build job + uses: NathanFirmo/wait-for-other-job@v1.1.1 + - uses: actions/download-artifact@v3 + with: + name: build-artifacts + - name: Unzip artifacts (Linux, macOS) + if: runner.os != 'Windows' + run: unzip -o compressed-build.zip + - name: Unzip artifacts (Windows) + if: runner.os == 'Windows' + run: 7z x compressed-build.zip -aoa -o${{ github.workspace }} + - name: Print directory structure + run: ls -R - name: Integration tests (${{ matrix.browser }}) run: yarn test-api-${{ matrix.browser }} --headless --forbid-only From e9cbb3e547dc8c60a7fd255206ee8a7532bd7577 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 22 Aug 2023 06:57:20 -0700 Subject: [PATCH 2/8] Add job name --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d6c3adf..a426746d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,6 +86,9 @@ jobs: run: yarn --frozen-lockfile - name: Wait for build job uses: NathanFirmo/wait-for-other-job@v1.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + job: build - uses: actions/download-artifact@v3 with: name: build-artifacts @@ -120,6 +123,9 @@ jobs: run: npx playwright install - name: Wait for build job uses: NathanFirmo/wait-for-other-job@v1.1.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + job: build - uses: actions/download-artifact@v3 with: name: build-artifacts From 516756fad8e1d292522ca2280b0fb79e80cbdde4 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 22 Aug 2023 07:01:27 -0700 Subject: [PATCH 3/8] Fix install step --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5454e84..ded90ebb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,7 +88,9 @@ jobs: node-version: ${{ matrix.node-version }}.x cache: 'yarn' - name: Install dependencies - run: yarn --frozen-lockfile + run: | + yarn --frozen-lockfile + yarn install-addons - name: Wait for build job uses: NathanFirmo/wait-for-other-job@v1.1.1 with: @@ -124,7 +126,9 @@ jobs: node-version: ${{ matrix.node-version }}.x cache: 'yarn' - name: Install dependencies - run: yarn --frozen-lockfile + run: | + yarn --frozen-lockfile + yarn install-addons - name: Install playwright run: npx playwright install - name: Wait for build job From 4bd154e7dc91fcab82462f3ad042a02ce4555424 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 22 Aug 2023 07:04:12 -0700 Subject: [PATCH 4/8] Split fast and slow unit tests to free agents --- .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ded90ebb..7435ab25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,12 +73,12 @@ jobs: - name: Lint API run: yarn lint-api - unit-tests: + unit-tests-fast: timeout-minutes: 20 strategy: matrix: - node-version: [16, 18] - runs-on: [ubuntu, macos, windows] + node-version: [18] + runs-on: [ubuntu, macos] runs-on: ${{ matrix.runs-on }}-latest steps: - uses: actions/checkout@v3 @@ -110,6 +110,39 @@ jobs: - name: Unit tests run: yarn test-unit --forbid-only + unit-tests: + needs: build + timeout-minutes: 20 + strategy: + matrix: + node-version: [16] + runs-on: [ubuntu, macos, windows] + runs-on: ${{ matrix.runs-on }}-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }}.x + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }}.x + cache: 'yarn' + - name: Install dependencies + run: | + yarn --frozen-lockfile + yarn install-addons + - uses: actions/download-artifact@v3 + with: + name: build-artifacts + - name: Unzip artifacts (Linux, macOS) + if: runner.os != 'Windows' + run: unzip -o compressed-build.zip + - name: Unzip artifacts (Windows) + if: runner.os == 'Windows' + run: 7z x compressed-build.zip -aoa -o${{ github.workspace }} + - name: Print directory structure + run: ls -R + - name: Unit tests + run: yarn test-unit --forbid-only + integration-tests: timeout-minutes: 20 strategy: From 06fbe69b09de28682af38c839ec6b27d57948a09 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 22 Aug 2023 07:05:55 -0700 Subject: [PATCH 5/8] Split out integration tests too --- .github/workflows/ci.yml | 42 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7435ab25..113e2ecd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,12 +73,12 @@ jobs: - name: Lint API run: yarn lint-api - unit-tests-fast: + unit-tests*: timeout-minutes: 20 strategy: matrix: node-version: [18] - runs-on: [ubuntu, macos] + runs-on: [ubuntu, macos, windows] runs-on: ${{ matrix.runs-on }}-latest steps: - uses: actions/checkout@v3 @@ -143,7 +143,7 @@ jobs: - name: Unit tests run: yarn test-unit --forbid-only - integration-tests: + integration-tests*: timeout-minutes: 20 strategy: matrix: @@ -182,3 +182,39 @@ jobs: run: ls -R - name: Integration tests (${{ matrix.browser }}) run: yarn test-api-${{ matrix.browser }} --headless --forbid-only + + integration-tests: + needs: build + timeout-minutes: 20 + strategy: + matrix: + node-version: [18] # just one as integration tests are about testing in browser + runs-on: [windows] # macos is flaky + browser: [chromium, firefox] + runs-on: ${{ matrix.runs-on }}-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }}.x + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }}.x + cache: 'yarn' + - name: Install dependencies + run: | + yarn --frozen-lockfile + yarn install-addons + - name: Install playwright + run: npx playwright install + - uses: actions/download-artifact@v3 + with: + name: build-artifacts + - name: Unzip artifacts (Linux, macOS) + if: runner.os != 'Windows' + run: unzip -o compressed-build.zip + - name: Unzip artifacts (Windows) + if: runner.os == 'Windows' + run: 7z x compressed-build.zip -aoa -o${{ github.workspace }} + - name: Print directory structure + run: ls -R + - name: Integration tests (${{ matrix.browser }}) + run: yarn test-api-${{ matrix.browser }} --headless --forbid-only From 2c25dd197053ce388b478a1b0434450306fb4e2d Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 22 Aug 2023 07:14:11 -0700 Subject: [PATCH 6/8] Fix invalid names --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 113e2ecd..47d4f45c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: - name: Lint API run: yarn lint-api - unit-tests*: + unit-tests-fast: timeout-minutes: 20 strategy: matrix: @@ -143,7 +143,7 @@ jobs: - name: Unit tests run: yarn test-unit --forbid-only - integration-tests*: + integration-tests-fast: timeout-minutes: 20 strategy: matrix: From ec4c018f734f68b033b2a5d76211adde9beb451e Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 22 Aug 2023 07:15:02 -0700 Subject: [PATCH 7/8] Remove windows from fast --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47d4f45c..f51a2736 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,7 +148,7 @@ jobs: strategy: matrix: node-version: [18] # just one as integration tests are about testing in browser - runs-on: [ubuntu, windows] # macos is flaky + runs-on: [ubuntu] # macos is flaky browser: [chromium, firefox] runs-on: ${{ matrix.runs-on }}-latest steps: From 92f1881dfe7dd5a1bd84b44cf92a8542dc559da3 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 22 Aug 2023 07:21:27 -0700 Subject: [PATCH 8/8] Polish job names This matches the npm script names closer --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f51a2736..531103c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: - name: Lint API run: yarn lint-api - unit-tests-fast: + unit-test-parallel: timeout-minutes: 20 strategy: matrix: @@ -110,7 +110,7 @@ jobs: - name: Unit tests run: yarn test-unit --forbid-only - unit-tests: + unit-test: needs: build timeout-minutes: 20 strategy: @@ -143,7 +143,7 @@ jobs: - name: Unit tests run: yarn test-unit --forbid-only - integration-tests-fast: + test-api-parallel: timeout-minutes: 20 strategy: matrix: @@ -183,7 +183,7 @@ jobs: - name: Integration tests (${{ matrix.browser }}) run: yarn test-api-${{ matrix.browser }} --headless --forbid-only - integration-tests: + test-api: needs: build timeout-minutes: 20 strategy: