Skip to content
Latchkey

Test workflow (OpenBMB/AgentVerse)

The Test workflow from OpenBMB/AgentVerse, 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: OpenBMB/AgentVerse.github/workflows/test.ymlLicense Apache-2.0View source

What it does

This is the Test workflow from the OpenBMB/AgentVerse 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: Test

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  test:
    runs-on: ${{ matrix.os }}
    if: "!contains(github.event.head_commit.message, 'ci skip')"
    strategy:
      matrix:
        os: [macos-latest, windows-latest, ubuntu-latest]
    steps:
    - name: Cancel previous run
      uses: styfle/cancel-workflow-action@0.11.0
      with:
        access_token: ${{ github.token }}
    - uses: actions/checkout@v3
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        python-version: 3.9
    - name: Upgrade pip
      run: |
        python -m pip install --upgrade pip setuptools wheel
    - name: Install dependencies
      run: |
        python -m pip install -r requirements.txt
    - name: Test
      env: 
        OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
        OPENAI_ORGANIZATION: ${{ secrets.OPENAI_ORGANIZATION }}
        OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL  }}
      run: |
        python setup.py develop 
        python agentverse_command/benchmark.py --task tasksolving/mgsm/gpt-3.5 --dataset_path data/mgsm/test_sample.jsonl --overwrite --output_path ci_smoke_test_output --tasks_dir ./agentverse/tasks
        python scripts/evaluate_math.py --path ci_smoke_test_output/results.jsonl --ci_smoke_test

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: Test
 
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  test:
    timeout-minutes: 30
    runs-on: ${{ matrix.os }}
    if: "!contains(github.event.head_commit.message, 'ci skip')"
    strategy:
      matrix:
        os: [macos-latest, windows-latest, ubuntu-latest]
    steps:
    - name: Cancel previous run
      uses: styfle/cancel-workflow-action@0.11.0
      with:
        access_token: ${{ github.token }}
    - uses: actions/checkout@v3
    - name: Set up Python 3.9
      uses: actions/setup-python@v4
      with:
        cache: 'pip'
        python-version: 3.9
    - name: Upgrade pip
      run: |
        python -m pip install --upgrade pip setuptools wheel
    - name: Install dependencies
      run: |
        python -m pip install -r requirements.txt
    - name: Test
      env: 
        OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
        OPENAI_ORGANIZATION: ${{ secrets.OPENAI_ORGANIZATION }}
        OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL  }}
      run: |
        python setup.py develop 
        python agentverse_command/benchmark.py --task tasksolving/mgsm/gpt-3.5 --dataset_path data/mgsm/test_sample.jsonl --overwrite --output_path ci_smoke_test_output --tasks_dir ./agentverse/tasks
        python scripts/evaluate_math.py --path ci_smoke_test_output/results.jsonl --ci_smoke_test
 

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