-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,63 @@ This can be done by setting the `cache-write` argument. | |
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | ||
``` | ||
|
||
### Multiple environments | ||
|
||
With pixi, you can create multiple environments for different requirements. | ||
You can also specify which environment(s) you want to install by setting the `environments` input argument. | ||
This will install all environments that are specified and cache them. | ||
|
||
```toml | ||
[project] | ||
name = "my-package" | ||
channels = ["conda-forge"] | ||
platforms = ["linux-64"] | ||
[dependencies] | ||
python = ">=3.11" | ||
pip = "*" | ||
polars = ">=0.14.24,<0.21" | ||
[feature.py311.dependencies] | ||
python = "3.11.*" | ||
[feature.py312.dependencies] | ||
python = "3.12.*" | ||
[environments] | ||
py311 = ["py311"] | ||
py312 = ["py312"] | ||
``` | ||
|
||
#### Multiple environments using a matrix | ||
|
||
The following example will install the `py311` and `py312` environments in different jobs. | ||
|
||
```yml | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
environment: [py311, py312] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
environments: ${{ matrix.environment }} | ||
``` | ||
|
||
#### Install multiple environments in one job | ||
|
||
The following example will install both the `py311` and the `py312` environment on the runner. | ||
|
||
```yml | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
# separated by spaces | ||
environments: >- | ||
py311 | ||
py312 | ||
``` | ||
|
||
### Authentication | ||
|
||
There are currently three ways to authenticate with pixi: | ||
|