Code Checks workflow (griptape-ai/griptape)
The Code Checks workflow from griptape-ai/griptape, explained and optimized by Latchkey.
CI health: B - good
Point runs-on at Latchkey and get job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Code Checks workflow from the griptape-ai/griptape 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: Code Checks
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
merge_group:
types: [checks_requested]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
format:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
steps:
- name: Checkout actions
uses: actions/checkout@v7
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run formatter
run: make check/format
type-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
steps:
- name: Checkout actions
uses: actions/checkout@v7
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run type checker
run: make check/types
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
steps:
- name: Checkout actions
uses: actions/checkout@v7
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run linter
run: make check/lint
coverage:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
steps:
- name: Checkout actions
uses: actions/checkout@v7
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run unit tests
run: make test/unit/coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
flags: smart-tests
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
spell-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
steps:
- name: Checkout actions
uses: actions/checkout@v7
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run linter
run: make check/spell
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Code Checks on: push: branches: [ "main" ] pull_request: branches: [ "main" ] merge_group: types: [checks_requested] permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: format: timeout-minutes: 30 runs-on: latchkey-small strategy: fail-fast: false matrix: python-version: ["3.10"] steps: - name: Checkout actions uses: actions/checkout@v7 - name: Init environment uses: ./.github/actions/init-environment - name: Run formatter run: make check/format type-check: timeout-minutes: 30 runs-on: latchkey-small strategy: fail-fast: false matrix: python-version: [ "3.10" ] steps: - name: Checkout actions uses: actions/checkout@v7 - name: Init environment uses: ./.github/actions/init-environment - name: Run type checker run: make check/types lint: timeout-minutes: 30 runs-on: latchkey-small strategy: fail-fast: false matrix: python-version: [ "3.10" ] steps: - name: Checkout actions uses: actions/checkout@v7 - name: Init environment uses: ./.github/actions/init-environment - name: Run linter run: make check/lint coverage: timeout-minutes: 30 runs-on: latchkey-small strategy: fail-fast: false matrix: python-version: ["3.10"] steps: - name: Checkout actions uses: actions/checkout@v7 - name: Init environment uses: ./.github/actions/init-environment - name: Run unit tests run: make test/unit/coverage - name: Upload coverage to Codecov uses: codecov/codecov-action@v7 with: flags: smart-tests verbose: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} spell-check: timeout-minutes: 30 runs-on: latchkey-small strategy: fail-fast: false matrix: python-version: [ "3.10" ] steps: - name: Checkout actions uses: actions/checkout@v7 - name: Init environment uses: ./.github/actions/init-environment - name: Run linter run: make check/spell
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. - 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.
This workflow runs 5 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.