Main Branch CI workflow (NVIDIA/NeMo-Retriever)
The Main Branch CI workflow from NVIDIA/NeMo-Retriever, explained and optimized by Latchkey.
C
CI health: C - fair
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Main Branch CI workflow from the NVIDIA/NeMo-Retriever 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: Main Branch CI
on:
push:
branches:
- main
jobs:
# Pre-commit checks
pre-commit:
name: Pre-commit Checks
uses: ./.github/workflows/reusable-pre-commit.yml
# Build and test standard Docker image
docker-build-and-test:
name: Build & Test Docker (amd64)
uses: ./.github/workflows/reusable-docker-build-and-test.yml
with:
platform: 'linux/amd64'
target: 'service'
tags: 'nrl-service:main-${{ github.sha }}'
base-image: 'ubuntu'
base-image-tag: 'jammy-20250415.1'
test-selection: 'full'
pytest-markers: 'not integration'
coverage: true
runner: 'linux-large-disk'
secrets:
HF_ACCESS_TOKEN: ${{ secrets.HF_ACCESS_TOKEN }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Main Branch CI on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: # Pre-commit checks pre-commit: timeout-minutes: 30 name: Pre-commit Checks uses: ./.github/workflows/reusable-pre-commit.yml # Build and test standard Docker image docker-build-and-test: timeout-minutes: 30 name: Build & Test Docker (amd64) uses: ./.github/workflows/reusable-docker-build-and-test.yml with: platform: 'linux/amd64' target: 'service' tags: 'nrl-service:main-${{ github.sha }}' base-image: 'ubuntu' base-image-tag: 'jammy-20250415.1' test-selection: 'full' pytest-markers: 'not integration' coverage: true runner: 'linux-large-disk' secrets: HF_ACCESS_TOKEN: ${{ secrets.HF_ACCESS_TOKEN }}
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 2 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.