Skip to content
Latchkey

BrowserStack Smoke workflow (showdownjs/showdown)

The BrowserStack Smoke workflow from showdownjs/showdown, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: showdownjs/showdown.github/workflows/browserstack.ymlLicense MITView source

What it does

This is the BrowserStack Smoke workflow from the showdownjs/showdown 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

workflow (.yml)
name: BrowserStack Smoke

# Real-device smoke run via browserstack-node-sdk. Runs on PRs and on merges/commits to
# master; the fuller per-engine coverage on every push is the Vitest+Playwright job
# (browser.yml). Also available on manual dispatch.
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master, develop ]
  workflow_dispatch:

permissions:
  contents: read

jobs:
  browserstack:
    name: 'BrowserStack smoke (@playwright/test)'
    runs-on: ubuntu-latest
    # Skip on fork PRs: GitHub withholds secrets from forks, so the BrowserStack creds
    # would be missing. Same-repo PRs, pushes, and manual dispatch still run.
    if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
      - name: Use Node.js 20.x
        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
        with:
          node-version: 20.x
          cache: 'npm'
      - run: npm ci
      - name: Build dist (smoke suite injects the UMD bundle)
        run: npm run build
      - name: Run smoke suite on BrowserStack
        env:
          BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
          BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESSKEY }}
        run: npm run test:browserstack

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: BrowserStack Smoke
 
# Real-device smoke run via browserstack-node-sdk. Runs on PRs and on merges/commits to
# master; the fuller per-engine coverage on every push is the Vitest+Playwright job
# (browser.yml). Also available on manual dispatch.
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master, develop ]
  workflow_dispatch:
 
permissions:
  contents: read
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  browserstack:
    timeout-minutes: 30
    name: 'BrowserStack smoke (@playwright/test)'
    runs-on: latchkey-small
    # Skip on fork PRs: GitHub withholds secrets from forks, so the BrowserStack creds
    # would be missing. Same-repo PRs, pushes, and manual dispatch still run.
    if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
    steps:
      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
      - name: Use Node.js 20.x
        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
        with:
          node-version: 20.x
          cache: 'npm'
      - run: npm ci
      - name: Build dist (smoke suite injects the UMD bundle)
        run: npm run build
      - name: Run smoke suite on BrowserStack
        env:
          BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
          BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESSKEY }}
        run: npm run test:browserstack
 

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 per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow