Skip to content
Latchkey

Code Checks workflow (griptape-ai/griptape)

The Code Checks workflow from griptape-ai/griptape, explained and optimized by Latchkey.

B

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.

Grade your own workflow free or run it on Latchkey →
Source: griptape-ai/griptape.github/workflows/code-checks.ymlLicense Apache-2.0View source

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

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

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.

Actions used in this workflow