libs/infinity_emb CI workflow (michaelfeil/infinity)
The libs/infinity_emb CI workflow from michaelfeil/infinity, explained and optimized by Latchkey.
A
CI health: A - excellent
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 libs/infinity_emb CI workflow from the michaelfeil/infinity 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: libs/infinity_emb CI
on:
release:
types: [published]
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
schedule: # nightly
- cron: '0 0 * * *'
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
# If another push to the same PR or branch happens while this workflow is still running,
# cancel the earlier run in favor of the next run.
#
# There's no point in testing an outdated version of the code. GitHub only allows
# a limited number of job runners to be active at the same time, so it's better to cancel
# pointless jobs early so that more useful jobs can run sooner.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
POETRY_VERSION: "1.8.4"
WORKDIR: "libs/infinity_emb"
jobs:
lint-infinity_emb:
uses:
./.github/workflows/linting.yaml
with:
working-directory: libs/infinity_emb
secrets: inherit
lint-embed_package:
uses:
./.github/workflows/linting.yaml
with:
working-directory: libs/embed_package
extra_poetry: "--with test,lint,codespell"
secrets: inherit
test-infinity_emb:
uses:
./.github/workflows/test.yaml
with:
working-directory: libs/infinity_emb
upload_coverage: true
secrets: inherit
test-embed_package:
uses:
./.github/workflows/test.yaml
with:
working-directory: libs/embed_package
upload_coverage: false
extra_poetry: "--with test"
secrets: inheritThe same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
--- name: libs/infinity_emb CI on: release: types: [published] push: branches: - main - dev pull_request: branches: - main - dev schedule: # nightly - cron: '0 0 * * *' workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI # If another push to the same PR or branch happens while this workflow is still running, # cancel the earlier run in favor of the next run. # # There's no point in testing an outdated version of the code. GitHub only allows # a limited number of job runners to be active at the same time, so it's better to cancel # pointless jobs early so that more useful jobs can run sooner. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: POETRY_VERSION: "1.8.4" WORKDIR: "libs/infinity_emb" jobs: lint-infinity_emb: timeout-minutes: 30 uses: ./.github/workflows/linting.yaml with: working-directory: libs/infinity_emb secrets: inherit lint-embed_package: timeout-minutes: 30 uses: ./.github/workflows/linting.yaml with: working-directory: libs/embed_package extra_poetry: "--with test,lint,codespell" secrets: inherit test-infinity_emb: timeout-minutes: 30 uses: ./.github/workflows/test.yaml with: working-directory: libs/infinity_emb upload_coverage: true secrets: inherit test-embed_package: timeout-minutes: 30 uses: ./.github/workflows/test.yaml with: working-directory: libs/embed_package upload_coverage: false extra_poetry: "--with test" secrets: inherit
What changed
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 4 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.