Test Build workflow (openwrt/luci)
The Test Build workflow from openwrt/luci, explained and optimized by Latchkey.
CI health: C - fair
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 Test Build workflow from the openwrt/luci 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: Test Build
on:
pull_request:
permissions:
contents: read
checks: read
jobs:
wait-for-formalities:
name: Wait for FormalityCheck
runs-on: ubuntu-slim
steps:
- name: Wait for Check Run
uses: lewagon/wait-on-check-action@v1.8.0
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: 'FormalityCheck / Git & Commits'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 5
build:
needs: wait-for-formalities
uses: openwrt/actions-shared-workflows/.github/workflows/multi-arch-test-build.yml@main
with:
matrix: '{"include": [{"arch": "x86_64", "target": "x86-64"}]}'
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Test Build on: pull_request: permissions: contents: read checks: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: wait-for-formalities: timeout-minutes: 30 name: Wait for FormalityCheck runs-on: ubuntu-slim steps: - name: Wait for Check Run uses: lewagon/wait-on-check-action@v1.8.0 with: ref: ${{ github.event.pull_request.head.sha }} check-name: 'FormalityCheck / Git & Commits' repo-token: ${{ secrets.GITHUB_TOKEN }} wait-interval: 5 build: timeout-minutes: 30 needs: wait-for-formalities uses: openwrt/actions-shared-workflows/.github/workflows/multi-arch-test-build.yml@main with: matrix: '{"include": [{"arch": "x86_64", "target": "x86-64"}]}'
What changed
- 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.
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.
This workflow runs 2 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.