Skip to content
Latchkey

lint workflow (avibe-bot/avibe)

The lint workflow from avibe-bot/avibe, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get caching, 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: avibe-bot/avibe.github/workflows/lint.ymlLicense MITView source

What it does

This is the lint workflow from the avibe-bot/avibe repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

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

The workflow

workflow (.yml)
name: lint

on:
  pull_request:
  push:
    branches:
      - master

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
  ruff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v6
        with:
          python-version: '3.12'
          cache: "pip"
          cache-dependency-path: |
            pyproject.toml
            uv.lock
      - name: Run pre-commit (ruff)
        run: |
          pip install pre-commit
          pre-commit run --all-files

  build-linux-artifacts:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - uses: actions/setup-node@v5
        with:
          node-version: "22.14.0"
          cache: "npm"
          cache-dependency-path: ui/package-lock.json

      - name: Build UI assets
        working-directory: ui
        run: |
          npm ci
          npm run validate:theme
          npm run build

      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"
          cache: "pip"
          cache-dependency-path: |
            pyproject.toml
            uv.lock

      - name: Build package artifact
        run: |
          pip install build
          python -m build --wheel

      - uses: actions/upload-artifact@v5
        with:
          name: ui-dist-linux
          path: ui/dist
          if-no-files-found: error
          retention-days: 1

      - uses: actions/upload-artifact@v5
        with:
          name: vibe-wheel-linux
          path: dist/*.whl
          if-no-files-found: error
          retention-days: 1

  unit-test-shards:
    name: unit-tests (${{ matrix.shard }}/${{ matrix.shard-total }})
    runs-on: ubuntu-latest
    needs: build-linux-artifacts
    strategy:
      fail-fast: false
      matrix:
        shard: [0, 1, 2, 3]
        shard-total: [4]
    steps:
      - uses: actions/checkout@v5

      # hatchling force-includes ui/dist into the (editable) install, so it must
      # exist before `pip install -e .`.
      - uses: actions/download-artifact@v5
        with:
          name: ui-dist-linux
          path: ui/dist

      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"

      - uses: astral-sh/setup-uv@v8.2.0
        with:
          enable-cache: true
          save-cache: false
          cache-dependency-glob: |
            pyproject.toml
            uv.lock

      - name: Install package and test deps
        run: uv pip install --system -e . pytest

      - name: Run unit tests shard ${{ matrix.shard }}/${{ matrix.shard-total }}
        run: bash scripts/ci_unit_tests.sh "${{ matrix.shard }}" "${{ matrix.shard-total }}"

  unit-tests:
    runs-on: ubuntu-latest
    needs: unit-test-shards
    if: always()
    steps:
      - name: Verify unit test shards
        run: |
          if [ "${{ needs['unit-test-shards'].result }}" != "success" ]; then
            echo "Unit test shards finished with result: ${{ needs['unit-test-shards'].result }}"
            exit 1
          fi
          echo "All unit test shards passed."

  npm-wrapper:
    runs-on: [self-hosted, Linux, X64, avibe]
    steps:
      - uses: actions/checkout@v5

      - uses: actions/setup-node@v5
        with:
          node-version: "20"

      - name: Test npm entrypoint
        working-directory: npm/avibe
        run: npm test

      - name: Validate npm package contents
        working-directory: npm/avibe
        run: npm pack --dry-run

  install-upgrade-regression:
    runs-on: ubuntu-latest
    needs: build-linux-artifacts
    steps:
      - uses: actions/checkout@v5

      - uses: actions/download-artifact@v5
        with:
          name: ui-dist-linux
          path: ui/dist

      - uses: actions/download-artifact@v5
        with:
          name: vibe-wheel-linux
          path: dist

      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"

      - uses: astral-sh/setup-uv@v8.2.0
        with:
          enable-cache: true
          cache-dependency-glob: |
            pyproject.toml
            uv.lock

      - name: Install package and test dependencies
        run: |
          uv pip install --system dist/*.whl pytest

      - name: Run install and upgrade regressions
        run: |
          docker info
          export VIBE_INSTALL_TEST_WHEEL="$(ls dist/*.whl)"
          pytest \
            tests/test_upgrade_flow.py \
            tests/test_install_script.py \
            tests/e2e/test_install_command.py \
            tests/e2e/test_upgrade_command.py \
            -v

  windows-install-smoke:
    runs-on: windows-latest
    needs: build-linux-artifacts
    steps:
      - uses: actions/checkout@v5

      - uses: actions/download-artifact@v5
        with:
          name: vibe-wheel-linux
          path: dist

      - name: Run Windows installer smoke test
        shell: pwsh
        run: |
          $wheel = (Get-ChildItem dist\*.whl | Select-Object -First 1).FullName
          if (-not $wheel) {
            throw "Missing wheel artifact"
          }

          $env:AVIBE_INSTALL_PACKAGE_SPEC = $wheel
          & .\install.ps1 *>&1 | Tee-Object -FilePath install-output.log

          if (-not (Select-String -Path install-output.log -Pattern 'avibe-os installed successfully \(from custom package spec\)' -Quiet)) {
            throw "Installer output missing custom package success message"
          }

      - name: Verify vibe in fresh PowerShell session
        shell: pwsh
        run: |
          $env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path', 'User')

          $vibeCommand = Get-Command vibe -ErrorAction Stop
          $vibeCommand | Out-String | Tee-Object -FilePath vibe-command.log
          vibe version | Tee-Object -FilePath vibe-version.log

          if (-not $vibeCommand.Source.ToLowerInvariant().EndsWith('vibe.exe')) {
            throw "Get-Command vibe did not resolve to vibe.exe"
          }

          if (-not (Select-String -Path vibe-version.log -Pattern 'avibe-os ' -Quiet)) {
            throw "vibe version output missing expected marker"
          }

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: lint
 
on:
  pull_request:
  push:
    branches:
      - master
 
concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
 
env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
 
jobs:
  ruff:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v6
        with:
          python-version: '3.12'
          cache: "pip"
          cache-dependency-path: |
            pyproject.toml
            uv.lock
      - name: Run pre-commit (ruff)
        run: |
          pip install pre-commit
          pre-commit run --all-files
 
  build-linux-artifacts:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v5
 
      - uses: actions/setup-node@v5
        with:
          node-version: "22.14.0"
          cache: "npm"
          cache-dependency-path: ui/package-lock.json
 
      - name: Build UI assets
        working-directory: ui
        run: |
          npm ci
          npm run validate:theme
          npm run build
 
      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"
          cache: "pip"
          cache-dependency-path: |
            pyproject.toml
            uv.lock
 
      - name: Build package artifact
        run: |
          pip install build
          python -m build --wheel
 
      - uses: actions/upload-artifact@v5
        with:
          name: ui-dist-linux
          path: ui/dist
          if-no-files-found: error
          retention-days: 1
 
      - uses: actions/upload-artifact@v5
        with:
          name: vibe-wheel-linux
          path: dist/*.whl
          if-no-files-found: error
          retention-days: 1
 
  unit-test-shards:
    timeout-minutes: 30
    name: unit-tests (${{ matrix.shard }}/${{ matrix.shard-total }})
    runs-on: latchkey-small
    needs: build-linux-artifacts
    strategy:
      fail-fast: false
      matrix:
        shard: [0, 1, 2, 3]
        shard-total: [4]
    steps:
      - uses: actions/checkout@v5
 
      # hatchling force-includes ui/dist into the (editable) install, so it must
      # exist before `pip install -e .`.
      - uses: actions/download-artifact@v5
        with:
          name: ui-dist-linux
          path: ui/dist
 
      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"
 
      - uses: astral-sh/setup-uv@v8.2.0
        with:
          enable-cache: true
          save-cache: false
          cache-dependency-glob: |
            pyproject.toml
            uv.lock
 
      - name: Install package and test deps
        run: uv pip install --system -e . pytest
 
      - name: Run unit tests shard ${{ matrix.shard }}/${{ matrix.shard-total }}
        run: bash scripts/ci_unit_tests.sh "${{ matrix.shard }}" "${{ matrix.shard-total }}"
 
  unit-tests:
    timeout-minutes: 30
    runs-on: latchkey-small
    needs: unit-test-shards
    if: always()
    steps:
      - name: Verify unit test shards
        run: |
          if [ "${{ needs['unit-test-shards'].result }}" != "success" ]; then
            echo "Unit test shards finished with result: ${{ needs['unit-test-shards'].result }}"
            exit 1
          fi
          echo "All unit test shards passed."
 
  npm-wrapper:
    timeout-minutes: 30
    runs-on: [self-hosted, Linux, X64, avibe]
    steps:
      - uses: actions/checkout@v5
 
      - uses: actions/setup-node@v5
        with:
          cache: 'npm'
          node-version: "20"
 
      - name: Test npm entrypoint
        working-directory: npm/avibe
        run: npm test
 
      - name: Validate npm package contents
        working-directory: npm/avibe
        run: npm pack --dry-run
 
  install-upgrade-regression:
    timeout-minutes: 30
    runs-on: latchkey-small
    needs: build-linux-artifacts
    steps:
      - uses: actions/checkout@v5
 
      - uses: actions/download-artifact@v5
        with:
          name: ui-dist-linux
          path: ui/dist
 
      - uses: actions/download-artifact@v5
        with:
          name: vibe-wheel-linux
          path: dist
 
      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"
 
      - uses: astral-sh/setup-uv@v8.2.0
        with:
          enable-cache: true
          cache-dependency-glob: |
            pyproject.toml
            uv.lock
 
      - name: Install package and test dependencies
        run: |
          uv pip install --system dist/*.whl pytest
 
      - name: Run install and upgrade regressions
        run: |
          docker info
          export VIBE_INSTALL_TEST_WHEEL="$(ls dist/*.whl)"
          pytest \
            tests/test_upgrade_flow.py \
            tests/test_install_script.py \
            tests/e2e/test_install_command.py \
            tests/e2e/test_upgrade_command.py \
            -v
 
  windows-install-smoke:
    timeout-minutes: 30
    runs-on: windows-latest
    needs: build-linux-artifacts
    steps:
      - uses: actions/checkout@v5
 
      - uses: actions/download-artifact@v5
        with:
          name: vibe-wheel-linux
          path: dist
 
      - name: Run Windows installer smoke test
        shell: pwsh
        run: |
          $wheel = (Get-ChildItem dist\*.whl | Select-Object -First 1).FullName
          if (-not $wheel) {
            throw "Missing wheel artifact"
          }
 
          $env:AVIBE_INSTALL_PACKAGE_SPEC = $wheel
          & .\install.ps1 *>&1 | Tee-Object -FilePath install-output.log
 
          if (-not (Select-String -Path install-output.log -Pattern 'avibe-os installed successfully \(from custom package spec\)' -Quiet)) {
            throw "Installer output missing custom package success message"
          }
 
      - name: Verify vibe in fresh PowerShell session
        shell: pwsh
        run: |
          $env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path', 'User')
 
          $vibeCommand = Get-Command vibe -ErrorAction Stop
          $vibeCommand | Out-String | Tee-Object -FilePath vibe-command.log
          vibe version | Tee-Object -FilePath vibe-version.log
 
          if (-not $vibeCommand.Source.ToLowerInvariant().EndsWith('vibe.exe')) {
            throw "Get-Command vibe did not resolve to vibe.exe"
          }
 
          if (-not (Select-String -Path vibe-version.log -Pattern 'avibe-os ' -Quiet)) {
            throw "vibe version output missing expected marker"
          }
 

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 7 jobs (10 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