From efc3397609f5fc25ca82a335ce36279cabf72b48 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 11:40:38 -0700 Subject: [PATCH 01/18] chore: add support for running tests in CI --- .github/workflows/test.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..36015007 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +# Workflow for running automated tests. + +name: WebdriverIO Tests + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +jobs: + build: + timeout-minutes: 10 + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Npm Install + run: npm install + + - name: Run Tests + run: npm run test From 8be6637ff9bf5a2dcd4a4c99223e0962b2934384 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 11:46:47 -0700 Subject: [PATCH 02/18] chore: don't fail fast for test matrix --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 36015007..69452252 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest] From 34c3e473996cb1062e18fc396b103ed6bd8081c6 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 11:49:13 -0700 Subject: [PATCH 03/18] chore: add lint:fix and format:check scripts --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 9352f8a7..b8f6cbb1 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "ghpages": "webpack", "clean": "blockly-scripts clean", "lint": "eslint .", + "lint:fix": "eslint . --fix", "format": "prettier --write .", + "format:check": "prettier --check .", "predeploy": "blockly-scripts predeploy", "prepublishOnly": "npm login --registry https://wombat-dressing-room.appspot.com", "start": "blockly-scripts start", From b36c8b22d96b2a431916348ac56c02417c149f8f Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 11:50:28 -0700 Subject: [PATCH 04/18] chore: run eslint & prettier in CI --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80063ce2..39d71bac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,3 +20,37 @@ jobs: - run: npm ci - run: npm run build - run: npm run lint + + lint: + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Npm Install + run: npm install + + - name: Lint + run: npm run lint + + format: + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Npm Install + run: npm install + + - name: Check Format + run: npm run format:check From b898159985d57f141adbc0dfe934a97274d644f3 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 11:55:02 -0700 Subject: [PATCH 05/18] chore: remove redundant lint check & clean up workflow a bit --- .github/workflows/build.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39d71bac..06f4323c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,12 @@ # Build workflow name: Build -on: [pull_request, workflow_dispatch] +on: + workflow_dispatch: + pull_request: + push: + branches: + - main permissions: contents: read @@ -10,16 +15,19 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Node + - uses: actions/checkout@v4 + + - name: Use Node.js 20.x uses: actions/setup-node@v4 with: - node-version: latest + node-version: 20.x cache: 'npm' - - run: npm ci + + - name: Npm Install + run: npm install + + - name: Verify build - run: npm run build - - run: npm run lint lint: timeout-minutes: 5 @@ -32,10 +40,10 @@ jobs: with: node-version: 20.x - - name: Npm Install + - name: NPM install run: npm install - - name: Lint + - name: Eslint check format run: npm run lint format: @@ -49,8 +57,8 @@ jobs: with: node-version: 20.x - - name: Npm Install + - name: NPM install run: npm install - - name: Check Format + - name: Prettier check format run: npm run format:check From 36bdee2355aa5b2f85c960e168860f3b6cfadd26 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 11:58:32 -0700 Subject: [PATCH 06/18] chore: adjust name for build/lint workflow --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06f4323c..4bb17bd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ -# Build workflow -name: Build +# Build & lint checks workflow +name: Build & Lint checks on: workflow_dispatch: From 9953f0b98e535f358fb2690b622e9a0909645548 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:00:54 -0700 Subject: [PATCH 07/18] fix: remove extra '-' that breaks build job step --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4bb17bd6..b8d57a11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: run: npm install - name: Verify build - - run: npm run build + run: npm run build lint: timeout-minutes: 5 From 2b020aaa591ae5e640c66eabbf53cc26032cef4d Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:11:02 -0700 Subject: [PATCH 08/18] chore: try to build against latest v12 instead --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8d57a11..b86cf741 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout experimentation plugin + uses: actions/checkout@v4 + with: + path: plugin + + - name: Checkout core Blockly + uses: actions/checkout@v4 + with: + repository: 'google/blockly' + ref: 'rc/v12.0.0' + path: core-blockly - name: Use Node.js 20.x uses: actions/setup-node@v4 @@ -23,11 +33,29 @@ jobs: node-version: 20.x cache: 'npm' - - name: Npm Install - run: npm install + - name: NPM install + run: | + cd main + npm install + cd .. + cd core-blockly + npm install + cd .. + + - name: Link latest Blockly v12 + run: | + cd core-blockly + npm run package + cd dist + npm link + cd ../../plugin + npm link blockly + cd .. - name: Verify build - run: npm run build + run: | + cd plugin + npm run build lint: timeout-minutes: 5 From 0c9bccfdaa274c711c92e126d9f84d5800c8f1cb Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:16:00 -0700 Subject: [PATCH 09/18] fix: remove caching when setting up node (it shouldn't be needed) --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b86cf741..27040e21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20.x - cache: 'npm' - name: NPM install run: | From 7998ccf359ea142dfd1ad5f819d51bc039ce3825 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:17:26 -0700 Subject: [PATCH 10/18] fix: correct plugin checkout directory --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27040e21..6dcd2d2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout experimentation plugin uses: actions/checkout@v4 with: - path: plugin + path: main - name: Checkout core Blockly uses: actions/checkout@v4 @@ -47,13 +47,13 @@ jobs: npm run package cd dist npm link - cd ../../plugin + cd ../../main npm link blockly cd .. - name: Verify build run: | - cd plugin + cd main npm run build lint: From a6d20aff79e15eb1ef9d82c5a942e69c4a23f6af Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:19:29 -0700 Subject: [PATCH 11/18] feat: run wdio tests against latest v12 core --- .github/workflows/test.yml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69452252..42c115e4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,15 +23,41 @@ jobs: os: [ubuntu-latest, macos-latest] steps: - - uses: actions/checkout@v4 + - name: Checkout experimentation plugin + uses: actions/checkout@v4 + with: + path: main + + - name: Checkout core Blockly + uses: actions/checkout@v4 + with: + repository: 'google/blockly' + ref: 'rc/v12.0.0' + path: core-blockly - name: Use Node.js 20.x uses: actions/setup-node@v4 with: node-version: 20.x - - name: Npm Install - run: npm install - - - name: Run Tests + - name: NPM install + run: | + cd main + npm install + cd .. + cd core-blockly + npm install + cd .. + + - name: Link latest Blockly v12 + run: | + cd core-blockly + npm run package + cd dist + npm link + cd ../../main + npm link blockly + cd .. + + - name: Run tests run: npm run test From 6aa313100dbda1202dc03ee195ffbb69a4fa591d Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:21:13 -0700 Subject: [PATCH 12/18] fix: run tests in the plugin directory --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42c115e4..4e5bc60c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,4 +60,6 @@ jobs: cd .. - name: Run tests - run: npm run test + run: | + cd main + npm run test From f3d3258ee8742f410b409c0f9fd1224c801d2ccd Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:31:48 -0700 Subject: [PATCH 13/18] feat: add build tests for non-PRs that rely on pinned v12 --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dcd2d2d..f72b0b04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,55 @@ permissions: contents: read jobs: + build_tip_of_tree_v12: + name: Build test (against tip-of-tree core v12) + runs-on: ubuntu-latest + steps: + - name: Checkout experimentation plugin + uses: actions/checkout@v4 + with: + path: main + + - name: Checkout core Blockly + uses: actions/checkout@v4 + with: + repository: 'google/blockly' + ref: 'rc/v12.0.0' + path: core-blockly + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: NPM install + run: | + cd main + npm install + cd .. + cd core-blockly + npm install + cd .. + + - name: Link latest Blockly v12 + run: | + cd core-blockly + npm run package + cd dist + npm link + cd ../../main + npm link blockly + cd .. + + - name: Verify build + run: | + cd main + npm run build + build: + name: Build test (against pinned v12) + # Don't run pinned version checks for PRs. + if: ${{ !github.base_ref }} runs-on: ubuntu-latest steps: - name: Checkout experimentation plugin @@ -57,6 +105,7 @@ jobs: npm run build lint: + name: Eslint check timeout-minutes: 5 runs-on: ubuntu-latest steps: @@ -74,6 +123,7 @@ jobs: run: npm run lint format: + name: Prettier check timeout-minutes: 5 runs-on: ubuntu-latest steps: From bf10ef934c74ee3d6ef6e33c5d1fdb313a868e93 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:34:45 -0700 Subject: [PATCH 14/18] feat: add support for WebdriverIO tests with pinned v12 (non-PRs) --- .github/workflows/test.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e5bc60c..53d708ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,8 @@ permissions: contents: read jobs: - build: + webdriverio_tests_tip_of_tree_v12: + name: WebdriverIO tests (against tip-of-tree core v12) timeout-minutes: 10 runs-on: ${{ matrix.os }} @@ -63,3 +64,30 @@ jobs: run: | cd main npm run test + + webdriverio_tests: + name: WebdriverIO tests (against pinned v12) + # Don't run pinned version checks for PRs. + if: ${{ !github.base_ref }} + timeout-minutes: 10 + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - name: Checkout experimentation plugin + uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: NPM install + run: npm install + + - name: Run tests + run: npm run test From 7a8609aaa707a79085fac8e87214771682f9d873 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:35:24 -0700 Subject: [PATCH 15/18] fix: remove extra tip-of-tree stuff from pinned v12 build job --- .github/workflows/build.yml | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f72b0b04..bc691692 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,15 +65,6 @@ jobs: steps: - name: Checkout experimentation plugin uses: actions/checkout@v4 - with: - path: main - - - name: Checkout core Blockly - uses: actions/checkout@v4 - with: - repository: 'google/blockly' - ref: 'rc/v12.0.0' - path: core-blockly - name: Use Node.js 20.x uses: actions/setup-node@v4 @@ -81,28 +72,10 @@ jobs: node-version: 20.x - name: NPM install - run: | - cd main - npm install - cd .. - cd core-blockly - npm install - cd .. - - - name: Link latest Blockly v12 - run: | - cd core-blockly - npm run package - cd dist - npm link - cd ../../main - npm link blockly - cd .. + run: npm install - name: Verify build - run: | - cd main - npm run build + run: npm run build lint: name: Eslint check From 314f7bbb3a2dbbc2ed4442e45da8a1651a31a5e4 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:36:27 -0700 Subject: [PATCH 16/18] chore: rename tests workflow for less redundancy --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53d708ba..b3561226 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ # Workflow for running automated tests. -name: WebdriverIO Tests +name: Automated Tests on: workflow_dispatch: From e06c479c9926e44a2df692c706d92739fde34fdd Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 12:36:54 -0700 Subject: [PATCH 17/18] chore: capitalization consistency --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc691692..513764d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ # Build & lint checks workflow -name: Build & Lint checks +name: Build & Lint Checks on: workflow_dispatch: From afc835c9d8ea83ec131dae12685296ba727ede01 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Tue, 15 Apr 2025 19:38:55 +0000 Subject: [PATCH 18/18] chore: empty commit to re-trigger CI