Skip to content
Latchkey

OpenCanary Tests workflow (thinkst/opencanary)

The OpenCanary Tests workflow from thinkst/opencanary, explained and optimized by Latchkey.

F

CI health: F - at risk

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: thinkst/opencanary.github/workflows/opencanary_tests.ymlLicense BSD-3-ClauseView source

What it does

This is the OpenCanary Tests workflow from the thinkst/opencanary repository, a real project running GitHub Actions. It is shown here with attribution under its BSD-3-Clause license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: OpenCanary Tests

on:
  - "push"

jobs:
  precommit_tests:
    runs-on: "ubuntu-22.04"
    steps:
      - name: "Check out repository code"
        uses: "actions/checkout@v6"
      - name: Set up Python 3.10
        uses: actions/setup-python@v3
        with:
          python-version: "3.10"
      - name: Install pre-commit
        run: pip install pre-commit
      - name: Check pre-commit is happy
        run: pre-commit run --all-files
  opencanary_tests:
    env:
      UV_SYSTEM_PYTHON: 1
    strategy:
      matrix:
        python-version: ["3.10", "3.11", "3.12", "3.13"]
        os: ["ubuntu-22.04", "ubuntu-24.04", "macos-14", "macos-15", "macos-26"]
      fail-fast: false
    runs-on: ${{ matrix.os }}
    steps:
      - name: "Check out repository code"
        uses: "actions/checkout@v6"
      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          python-version: ${{ matrix.python-version }}
          enable-cache: true
      - name: Set up Python
        run: uv python install
      - name: Install OpenCanary
        run: uv sync --locked --dev
      - name: Copy config file
        run: cp opencanary/test/opencanary.conf .
      - name: Start OpenCanary
        run: uv run opencanaryd --start
      - name: Run Pytest
        run: uv run pytest -s

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: OpenCanary Tests
 
on:
  - "push"
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  precommit_tests:
    timeout-minutes: 30
    runs-on: "ubuntu-22.04"
    steps:
      - name: "Check out repository code"
        uses: "actions/checkout@v6"
      - name: Set up Python 3.10
        uses: actions/setup-python@v3
        with:
          cache: 'pip'
          python-version: "3.10"
      - name: Install pre-commit
        run: pip install pre-commit
      - name: Check pre-commit is happy
        run: pre-commit run --all-files
  opencanary_tests:
    timeout-minutes: 30
    env:
      UV_SYSTEM_PYTHON: 1
    strategy:
      matrix:
        python-version: ["3.10", "3.11", "3.12", "3.13"]
        os: ["ubuntu-22.04", "ubuntu-24.04", "macos-14", "macos-15", "macos-26"]
      fail-fast: false
    runs-on: ${{ matrix.os }}
    steps:
      - name: "Check out repository code"
        uses: "actions/checkout@v6"
      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          python-version: ${{ matrix.python-version }}
          enable-cache: true
      - name: Set up Python
        run: uv python install
      - name: Install OpenCanary
        run: uv sync --locked --dev
      - name: Copy config file
        run: cp opencanary/test/opencanary.conf .
      - name: Start OpenCanary
        run: uv run opencanaryd --start
      - name: Run Pytest
        run: uv run pytest -s
 

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