verify-templates workflow (Shpota/goxygen)
The verify-templates workflow from Shpota/goxygen, explained and optimized by Latchkey.
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.
What it does
This is the verify-templates workflow from the Shpota/goxygen 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
name: verify-templates
on:
push:
pull_request:
schedule:
- cron: '0 14 * * *'
jobs:
build:
name: Test generated project
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
db: [mongo, mysql, postgres]
frontend: [angular, vue, react]
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Generate application
run: go run main.go init --db ${{ matrix.db }} --frontend ${{ matrix.frontend }} app
- name: Start the application
run: cd app && docker compose up -d
- name: Check availability of backend
run: timeout 60 bash -c 'until curl -s localhost:8080/api/technologies | grep Go > /dev/null; do sleep 1; done'
- name: Check availability of frontend
run: |
npm i puppeteer
cat > index.js << EOF
const puppeteer = require('puppeteer');
(async () => {
try {
const browser = await puppeteer.launch({
headless: "new",
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
const page = await browser.newPage();
await page.goto('http://localhost:8080');
page.on('console', (message) => {
console.log('Console ' + message.type().toUpperCase() + ': ' + message.text());
});
await page.waitForSelector('.technologies', { timeout: 60000 });
const content = await page.content();
console.log(content);
await browser.close();
} catch (error) {
console.error('Error:', error);
throw error;
}
})();
EOF
node index.js
- name: Stop application
run: cd app && docker compose down
if: always()
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: verify-templates on: push: pull_request: schedule: - cron: '0 14 * * *' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: timeout-minutes: 30 name: Test generated project runs-on: latchkey-small strategy: fail-fast: false matrix: db: [mongo, mysql, postgres] frontend: [angular, vue, react] steps: - name: Checkout project uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version: '1.22' - name: Generate application run: go run main.go init --db ${{ matrix.db }} --frontend ${{ matrix.frontend }} app - name: Start the application run: cd app && docker compose up -d - name: Check availability of backend run: timeout 60 bash -c 'until curl -s localhost:8080/api/technologies | grep Go > /dev/null; do sleep 1; done' - name: Check availability of frontend run: | npm i puppeteer cat > index.js << EOF const puppeteer = require('puppeteer'); (async () => { try { const browser = await puppeteer.launch({ headless: "new", args: ['--no-sandbox', '--disable-setuid-sandbox'] }); const page = await browser.newPage(); await page.goto('http://localhost:8080'); page.on('console', (message) => { console.log('Console ' + message.type().toUpperCase() + ': ' + message.text()); }); await page.waitForSelector('.technologies', { timeout: 60000 }); const content = await page.content(); console.log(content); await browser.close(); } catch (error) { console.error('Error:', error); throw error; } })(); EOF node index.js - name: Stop application run: cd app && docker compose down if: always()
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.
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
- Network fetches
This workflow runs 1 job (9 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.