Skip to content
Latchkey

Run browser manually workflow (RaspberryPiFoundation/blockly)

The Run browser manually workflow from RaspberryPiFoundation/blockly, explained and optimized by Latchkey.

A

CI health: A - excellent

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: RaspberryPiFoundation/blockly.github/workflows/browser_test.ymlLicense Apache-2.0View source

What it does

This is the Run browser manually workflow from the RaspberryPiFoundation/blockly repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
# This workflow will do a clean install, start the selenium server, and run
# all of our browser based tests

name: Run browser manually

on:
  workflow_dispatch:
  schedule:
    - cron: '0 6 * * 1' # Runs every Monday at 06:00 UTC

permissions:
  contents: read

jobs:
  build:
    timeout-minutes: 120
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        # TODO (#2114): re-enable osx build.
        # os: [ubuntu-latest, macos-latest]
        os: [macos-latest]
        node-version: [22.x, 24.x]
        # See supported Node.js release schedule at
        # https://nodejs.org/en/about/releases/

    defaults:
      run:
        working-directory: ./packages/blockly

    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false

      - name: Reconfigure git to use HTTP authentication
        run: >
          git config --global url."https://github.com/".insteadOf
          ssh://git@github.com/

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node-version }}

      - name: Npm Install
        run: npm install

      - name: Linux Test Setup
        if: runner.os == 'Linux'
        run: source ./tests/scripts/setup_linux_env.sh

      - name: Run Build
        run: npm run build

      - name: Run Test
        run: npm run test:browser

        env:
          CI: true

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

# This workflow will do a clean install, start the selenium server, and run
# all of our browser based tests
 
name: Run browser manually
 
on:
  workflow_dispatch:
  schedule:
    - cron: '0 6 * * 1' # Runs every Monday at 06:00 UTC
 
permissions:
  contents: read
 
jobs:
  build:
    timeout-minutes: 120
    runs-on: ${{ matrix.os }}
 
    strategy:
      matrix:
        # TODO (#2114): re-enable osx build.
        # os: [ubuntu-latest, macos-latest]
        os: [macos-latest]
        node-version: [22.x, 24.x]
        # See supported Node.js release schedule at
        # https://nodejs.org/en/about/releases/
 
    defaults:
      run:
        working-directory: ./packages/blockly
 
    steps:
      - uses: actions/checkout@v7
        with:
          persist-credentials: false
 
      - name: Reconfigure git to use HTTP authentication
        run: >
          git config --global url."https://github.com/".insteadOf
          ssh://git@github.com/
 
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v6
        with:
          cache: 'npm'
          node-version: ${{ matrix.node-version }}
 
      - name: Npm Install
        run: npm install
 
      - name: Linux Test Setup
        if: runner.os == 'Linux'
        run: source ./tests/scripts/setup_linux_env.sh
 
      - name: Run Build
        run: npm run build
 
      - name: Run Test
        run: npm run test:browser
 
        env:
          CI: true
 

What changed

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 1 job (2 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow