Quick Start
.github/workflows/ci.yml
Version Pinning with Dependabot
Automatically update the action version:.github/dependabot.yml
Key Features
Caching
Automatic caching speeds up workflows by reusing installed environments.Project Environment Caching
Enabled by default whenpixi.lock exists:
Global Environment Caching
Disabled by default, expires monthly:Custom Cache Keys
Customize cache key prefixes:Save Caches Only on Main
Prevent hitting the 10GB cache limit:Multiple Environments
Test across different Python versions or configurations.Environment Configuration
pixi.toml
Matrix Strategy
Multiple Environments in One Job
Global Environments
Install tools needed beforepixi install runs:
Authentication
Token Authentication
For prefix.dev and similar services:Username and Password
For Artifactory and enterprise environments:Conda Token
For anaconda.org and Quetz:S3 Authentication
PyPI Keyring Provider
Custom Shell Wrapper
Run commands inside the Pixi environment withoutpixi run:
The
{0} placeholder is replaced with a temporary script file created by GitHub Actions.One-off Commands with pixi exec
Run commands in a temporary environment:Environment Activation
Activate the environment for all subsequent steps:With Multiple Environments
Lock File Management
—frozen Flag
Reject any changes to the lockfile:—locked Flag
Only install if lockfile is up-to-date:By default, the action runs:
pixi install --lockedifpixi.lockexistspixi installotherwise
Debugging
Action Debug Logging
Enable by re-running the workflow in debug mode via the GitHub UI.Pixi Debug Logging
vv when action debug logging is enabled.
Self-Hosted Runners
Configure cleanup and custom paths for self-hosted runners:.pixienvironment- Pixi binary
- Rattler cache
- Other rattler files in
~/.rattler
Use Pre-installed Pixi
If Pixi is already installed on the runner, omit version configuration:Advanced Configuration
pyproject.toml as Manifest
Usepyproject.toml instead of pixi.toml:
The action auto-detects
pyproject.toml if it contains [tool.pixi.workspace] and no pixi.toml exists.Working Directory for Monorepos
Custom Download URL
Download Pixi from a custom mirror:Install-Only Mode
Only install Pixi without runningpixi install:
Complete Example
.github/workflows/ci.yml
Best Practices
Pin Versions
Always pin the action version and use Dependabot for updates.
Cache Wisely
Only save caches on main branch to avoid hitting the 10GB limit.
Use Secrets
Store all sensitive data in GitHub Secrets, never in code.
Matrix Testing
Test across multiple OS and Python versions for better coverage.
Locked Installs
Use
locked: true in CI to ensure reproducible builds.