Skip to content
Latchkey

verify-templates workflow (Shpota/goxygen)

The verify-templates workflow from Shpota/goxygen, 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: Shpota/goxygen.github/workflows/verify-templates.ymlLicense Apache-2.0View source

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

workflow (.yml)
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

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 (9 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