A GitHub Action to run a Calkit project's pipeline and optionally save results (commit and push) to Git and DVC.
The example workflow below shows how to run a Calkit project, saving results.
Note the permissions, concurrency, and checkout options.
The action detects required environment kinds from calkit.yaml and sets up
needed tooling (for example Calkit via uv, Julia, Pixi, Conda, R, MATLAB,
and Docker Buildx) before running.
name: Run pipeline
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: write
id-token: write
# Make sure we only ever run one per branch so we don't have issues pushing
# after running the pipeline
concurrency:
group: calkit-run-${{ github.ref }}
cancel-in-progress: false
jobs:
main:
name: Run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# For PRs, checkout the head ref to avoid detached HEAD
ref: ${{ github.head_ref || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
# This action automatically runs necessary setup steps based on environments
- name: Run Calkit
uses: calkit/run-action@v2If simply running the pipeline is desired, the save option can be set to
false.
Additionally, caching DVC data can be disabled with cache_dvc: false.
When caching is enabled, the action saves DVC cache entries using the current
branch name plus the current commit SHA.
The restore step first looks for the
most recent cache for the current branch and then falls back to the default
branch cache if the current branch cache doesn't exist yet.
System dependencies like uv, pixi, conda, juliaup will be installed
automatically if missing, and if the project has an environment with the
corresponding kind.
If you'd like control over which versions are used, you can add setup steps
before the Calkit Action, and Calkit will detect and skip installation.