Skip to content
Latchkey

ci workflow (canimus/cuallee)

The ci workflow from canimus/cuallee, explained and optimized by Latchkey.

F

CI health: F - at risk

Point runs-on at Latchkey and get caching, run de-duplication, 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: canimus/cuallee.github/workflows/ci.ymlLicense Apache-2.0View source

What it does

This is the ci workflow from the canimus/cuallee 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: ci
on:
  push:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: 'actions/checkout@v3'
    - name: Setup Python
      uses: actions/setup-python@master
      with:
        python-version: 3.11
    - name: Authenticate google cloud
      uses: 'google-github-actions/auth@v1'
      with:
        credentials_json: ${{ secrets.GOOGLE_KEY }}
    - name: Generate coverage report
      run: |
        pip install --upgrade pip
        pip install '.[test,snowpark,pyspark,pandas,duckdb,bigquery,polars,dagster,cloud,pdf,daft]'
        coverage run -m pytest --ignore=test/unit/bigquery test/unit
        coverage xml -o coverage.xml
      env:
        SF_ACCOUNT: ${{ secrets.SF_ACCOUNT }}
        SF_USER: ${{ secrets.SF_USER }}
        SF_PASSWORD: ${{ secrets.SF_PASSWORD }}
        SF_ROLE: ${{ secrets.SF_ROLE }}
        SF_WAREHOUSE: ${{ secrets.SF_WAREHOUSE }}
        SF_DATABASE: ${{ secrets.SF_DATABASE }}
        SF_SCHEMA: ${{ secrets.SF_SCHEMA }}
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v3
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        directory: .
        env_vars: OS,PYTHON
        fail_ci_if_error: true
        files: coverage.xml
        flags: unittests
        name: codecov-umbrella
        verbose: true
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: 3.x
      - run: pip install mkdocs-material mkdocstrings[python]
      - run: mkdocs gh-deploy --force

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: ci
on:
  push:
    branches:
      - main
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  test:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
    - uses: 'actions/checkout@v3'
    - name: Setup Python
      uses: actions/setup-python@master
      with:
        cache: 'pip'
        python-version: 3.11
    - name: Authenticate google cloud
      uses: 'google-github-actions/auth@v1'
      with:
        credentials_json: ${{ secrets.GOOGLE_KEY }}
    - name: Generate coverage report
      run: |
        pip install --upgrade pip
        pip install '.[test,snowpark,pyspark,pandas,duckdb,bigquery,polars,dagster,cloud,pdf,daft]'
        coverage run -m pytest --ignore=test/unit/bigquery test/unit
        coverage xml -o coverage.xml
      env:
        SF_ACCOUNT: ${{ secrets.SF_ACCOUNT }}
        SF_USER: ${{ secrets.SF_USER }}
        SF_PASSWORD: ${{ secrets.SF_PASSWORD }}
        SF_ROLE: ${{ secrets.SF_ROLE }}
        SF_WAREHOUSE: ${{ secrets.SF_WAREHOUSE }}
        SF_DATABASE: ${{ secrets.SF_DATABASE }}
        SF_SCHEMA: ${{ secrets.SF_SCHEMA }}
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v3
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        directory: .
        env_vars: OS,PYTHON
        fail_ci_if_error: true
        files: coverage.xml
        flags: unittests
        name: codecov-umbrella
        verbose: true
  docs:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          cache: 'pip'
          python-version: 3.x
      - run: pip install mkdocs-material mkdocstrings[python]
      - run: mkdocs gh-deploy --force
 

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.

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 2 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