CI workflow (GargantuaX/gemini-watermark-remover)
The CI workflow from GargantuaX/gemini-watermark-remover, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the CI workflow from the GargantuaX/gemini-watermark-remover 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: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.11.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Validate sample fixtures
run: |
if [ ! -d src/assets/samples ] || [ -z "$(ls -A src/assets/samples)" ]; then
echo "Missing regression fixtures in src/assets/samples"
exit 1
fi
- name: Build
run: pnpm build
- name: Project surface regression
run: node --test tests/project/frontendI18nRetirement.test.js tests/project/publicStaticSurfaceRetirement.test.js tests/project/deploymentRetirement.test.js
- name: SDK publish smoke
run: pnpm test:sdk-smoke
- name: Install Playwright Chromium
run: pnpm exec playwright install --with-deps chromium
- name: Test
run: pnpm test
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: CI on: pull_request: branches: - main push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build-and-test: timeout-minutes: 30 runs-on: latchkey-small steps: - name: Checkout uses: actions/checkout@v4 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 10.11.0 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 22 cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile - name: Validate sample fixtures run: | if [ ! -d src/assets/samples ] || [ -z "$(ls -A src/assets/samples)" ]; then echo "Missing regression fixtures in src/assets/samples" exit 1 fi - name: Build run: pnpm build - name: Project surface regression run: node --test tests/project/frontendI18nRetirement.test.js tests/project/publicStaticSurfaceRetirement.test.js tests/project/deploymentRetirement.test.js - name: SDK publish smoke run: pnpm test:sdk-smoke - name: Install Playwright Chromium run: pnpm exec playwright install --with-deps chromium - name: Test run: pnpm test
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it 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
- End-to-end and browser tests
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.