Chrome frontend tests workflow (JuliaPluto/Pluto.jl)
The Chrome frontend tests workflow from JuliaPluto/Pluto.jl, explained and optimized by Latchkey.
CI health: D - needs work
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Chrome frontend tests workflow from the JuliaPluto/Pluto.jl repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Chrome frontend tests
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
paths-ignore:
- "**.md"
branches:
- main
- release
pull_request:
paths-ignore:
- "**.md"
branches-ignore:
- release
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
frontend-test:
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v7
# Makes thes `julia` command available
- uses: julia-actions/setup-julia@v3
with:
version: "1.10" # our lowest supported version
- uses: julia-actions/cache@v3
- name: Install Pluto.jl packages
run: |
julia --project=$GITHUB_WORKSPACE -e "using Pkg; Pkg.instantiate()"
- uses: actions/setup-node@v6
with:
node-version: "22.x"
- name: Install dependencies
working-directory: ./test/frontend
run: |
npm install
- name: Run tests
working-directory: ./test/frontend
run: |
julia --project=$GITHUB_WORKSPACE -e 'import Pluto
# Run Pluto.jl server in the background
options = Pluto.Configuration.from_flat_kwargs(;
port=parse(Int, ENV["PLUTO_PORT"]),
require_secret_for_access=false,
)
🍭 = Pluto.ServerSession(; options)
server = Pluto.run!(🍭)
run(`npm run test`)
close(server)'
env:
PLUTO_PORT: 1235
PLUTO_TEST_OFFLINE: ${{ github.ref_name == 'release' }}
- uses: actions/upload-artifact@v7
if: failure()
with:
name: test-screenshot-artifacts
path: ${{ github.workspace }}/test/frontend/artifacts/*.png
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.
name: Chrome frontend tests # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the main branch on: push: paths-ignore: - "**.md" branches: - main - release pull_request: paths-ignore: - "**.md" branches-ignore: - release # A workflow run is made up of one or more jobs that can run sequentially or in parallel concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: frontend-test: runs-on: "ubuntu-latest" timeout-minutes: 30 steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v7 # Makes thes `julia` command available - uses: julia-actions/setup-julia@v3 with: version: "1.10" # our lowest supported version - uses: julia-actions/cache@v3 - name: Install Pluto.jl packages run: | julia --project=$GITHUB_WORKSPACE -e "using Pkg; Pkg.instantiate()" - uses: actions/setup-node@v6 with: cache: 'npm' node-version: "22.x" - name: Install dependencies working-directory: ./test/frontend run: | npm install - name: Run tests working-directory: ./test/frontend run: | julia --project=$GITHUB_WORKSPACE -e 'import Pluto # Run Pluto.jl server in the background options = Pluto.Configuration.from_flat_kwargs(; port=parse(Int, ENV["PLUTO_PORT"]), require_secret_for_access=false, ) 🍭 = Pluto.ServerSession(; options) server = Pluto.run!(🍭) run(`npm run test`) close(server)' env: PLUTO_PORT: 1235 PLUTO_TEST_OFFLINE: ${{ github.ref_name == 'release' }} - uses: actions/upload-artifact@v7 if: failure() with: name: test-screenshot-artifacts path: ${{ github.workspace }}/test/frontend/artifacts/*.png
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
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:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.