Skip to content
Latchkey

Conda build workflow (dask/dask)

The Conda build workflow from dask/dask, explained and optimized by Latchkey.

B

CI health: B - good

Point runs-on at Latchkey and get 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: dask/dask.github/workflows/conda.ymlLicense BSD-3-ClauseView source

What it does

This is the Conda build workflow from the dask/dask repository, a real project running GitHub Actions. It is shown here with attribution under its BSD-3-Clause license.

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

The workflow

workflow (.yml)
name: Conda build

on:
  push:
    branches: [main]
    tags: ["*"]
  pull_request:
  workflow_dispatch:

# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
  group: conda-${{ github.ref }}
  cancel-in-progress: true

jobs:
  conda:
    name: Build (and upload)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          fetch-depth: 0

      - uses: prefix-dev/setup-pixi@v0.10.0
        with:
          pixi-version: v0.72.1
          environments: build
          cache: true
          locked: true
      
      - name: Build conda package
        run: pixi r conda-build

      - name: Upload conda build artifact
        uses: actions/upload-artifact@v7
        with:
          name: conda-channel
          path: dist/conda
          if-no-files-found: error

      - name: Upload conda package
        if: |
          github.event_name == 'push'
          && github.ref == 'refs/heads/main'
          && github.repository == 'dask/dask'
        env:
          ANACONDA_API_TOKEN: ${{ secrets.DASK_CONDA_TOKEN }}
        run: pixi r conda-upload

The same workflow, on Latchkey

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

name: Conda build
 
on:
  push:
    branches: [main]
    tags: ["*"]
  pull_request:
  workflow_dispatch:
 
# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
  group: conda-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  conda:
    timeout-minutes: 30
    name: Build (and upload)
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v7
        with:
          fetch-depth: 0
 
      - uses: prefix-dev/setup-pixi@v0.10.0
        with:
          pixi-version: v0.72.1
          environments: build
          cache: true
          locked: true
      
      - name: Build conda package
        run: pixi r conda-build
 
      - name: Upload conda build artifact
        uses: actions/upload-artifact@v7
        with:
          name: conda-channel
          path: dist/conda
          if-no-files-found: error
 
      - name: Upload conda package
        if: |
          github.event_name == 'push'
          && github.ref == 'refs/heads/main'
          && github.repository == 'dask/dask'
        env:
          ANACONDA_API_TOKEN: ${{ secrets.DASK_CONDA_TOKEN }}
        run: pixi r conda-upload
 

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.

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow