Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
efc3397
chore: add support for running tests in CI
BenHenning Apr 15, 2025
8be6637
chore: don't fail fast for test matrix
BenHenning Apr 15, 2025
34c3e47
chore: add lint:fix and format:check scripts
BenHenning Apr 15, 2025
b36c8b2
chore: run eslint & prettier in CI
BenHenning Apr 15, 2025
641aa95
Merge branch 'main' into add-ci-workflows
BenHenning Apr 15, 2025
b898159
chore: remove redundant lint check & clean up workflow a bit
BenHenning Apr 15, 2025
36bdee2
chore: adjust name for build/lint workflow
BenHenning Apr 15, 2025
9953f0b
fix: remove extra '-' that breaks build job step
BenHenning Apr 15, 2025
2b020aa
chore: try to build against latest v12 instead
BenHenning Apr 15, 2025
0c9bccf
fix: remove caching when setting up node (it shouldn't be needed)
BenHenning Apr 15, 2025
7998ccf
fix: correct plugin checkout directory
BenHenning Apr 15, 2025
a6d20af
feat: run wdio tests against latest v12 core
BenHenning Apr 15, 2025
6aa3131
fix: run tests in the plugin directory
BenHenning Apr 15, 2025
f3d3258
feat: add build tests for non-PRs that rely on pinned v12
BenHenning Apr 15, 2025
bf10ef9
feat: add support for WebdriverIO tests with pinned v12 (non-PRs)
BenHenning Apr 15, 2025
7a8609a
fix: remove extra tip-of-tree stuff from pinned v12 build job
BenHenning Apr 15, 2025
314f7bb
chore: rename tests workflow for less redundancy
BenHenning Apr 15, 2025
e06c479
chore: capitalization consistency
BenHenning Apr 15, 2025
afc835c
chore: empty commit to re-trigger CI
BenHenning Apr 15, 2025
21284c7
Merge branch 'main' into add-ci-workflows
BenHenning Apr 15, 2025
e4e7859
Merge branch 'main' into add-ci-workflows
BenHenning Apr 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 102 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,114 @@
# Build workflow
name: Build
# Build & lint checks workflow
name: Build & Lint Checks

on: [pull_request, workflow_dispatch]
on:
workflow_dispatch:
pull_request:
push:
branches:
- main

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
- name: Checkout experimentation plugin
uses: actions/checkout@v4
- name: Setup Node

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: latest
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run lint
node-version: 20.x

- name: NPM install
run: npm install

- name: Verify build
run: npm run build

lint:
name: Eslint check
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: Eslint check format
run: npm run lint

format:
name: Prettier check
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: Prettier check format
run: npm run format:check
93 changes: 93 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Workflow for running automated tests.

name: Automated Tests

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
webdriverio_tests_tip_of_tree_v12:
name: WebdriverIO tests (against tip-of-tree core v12)
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
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: Run tests
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down