Skip to content
Latchkey

integration-app-harness workflow (dot-agent/nextpy)

The integration-app-harness workflow from dot-agent/nextpy, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get run de-duplication, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: dot-agent/nextpy.github/workflows/integration_app_harness.ymlLicense Apache-2.0View source

What it does

This is the integration-app-harness workflow from the dot-agent/nextpy 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: integration-app-harness

on:
  push:
    branches: [ "main" ]
    paths-ignore:
      - '**/*.md'
  pull_request:
    branches: [ "main" ]
    paths-ignore:
      - '**/*.md'

permissions:
  contents: read

jobs:
  integration-app-harness:
    timeout-minutes: 30
    strategy:
      matrix:
        state_manager: [ "redis", "memory" ]
    runs-on: ubuntu-latest
    services:
      # Label used to access the service container
      redis:
        image: ${{ matrix.state_manager == 'redis' && 'redis' || '' }}
        # Set health checks to wait until redis has started
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # Maps port 6379 on service container to the host
          - 6379:6379
    steps:
    - uses: actions/checkout@v4
    - uses: ./.github/actions/setup_build_env
      with:
          python-version: "3.11.5"
          run-poetry-install: true
          create-venv-at-path: .venv
    - run: poetry run pip install pyvirtualdisplay pillow
    - name: Run app harness tests
      env:
        SCREENSHOT_DIR: /tmp/screenshots
        REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }}
      run: |
        poetry run pytest integration
    - uses: actions/upload-artifact@v3
      name: Upload failed test screenshots
      if: always()
      with:
        name: failed_test_screenshots
        path: /tmp/screenshots

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: integration-app-harness
 
on:
  push:
    branches: [ "main" ]
    paths-ignore:
      - '**/*.md'
  pull_request:
    branches: [ "main" ]
    paths-ignore:
      - '**/*.md'
 
permissions:
  contents: read
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  integration-app-harness:
    timeout-minutes: 30
    strategy:
      matrix:
        state_manager: [ "redis", "memory" ]
    runs-on: latchkey-small
    services:
      # Label used to access the service container
      redis:
        image: ${{ matrix.state_manager == 'redis' && 'redis' || '' }}
        # Set health checks to wait until redis has started
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # Maps port 6379 on service container to the host
          - 6379:6379
    steps:
    - uses: actions/checkout@v4
    - uses: ./.github/actions/setup_build_env
      with:
          python-version: "3.11.5"
          run-poetry-install: true
          create-venv-at-path: .venv
    - run: poetry run pip install pyvirtualdisplay pillow
    - name: Run app harness tests
      env:
        SCREENSHOT_DIR: /tmp/screenshots
        REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }}
      run: |
        poetry run pytest integration
    - uses: actions/upload-artifact@v3
      name: Upload failed test screenshots
      if: always()
      with:
        name: failed_test_screenshots
        path: /tmp/screenshots

What changed

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 1 job (2 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