Skip to content

Commit

Permalink
Merge branch 'main' of github.com:jens-ox/setup-pixi into jens-ox/tsc…
Browse files Browse the repository at this point in the history
…onfig-setup
  • Loading branch information
jens-ox committed Aug 28, 2024
2 parents f87cfc1 + 35c26ad commit 80b340d
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create pull request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c
if: failure() && github.ref_name == 'main'
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
TAG_NAME: v${{ steps.version-metadata.outputs.newVersion }}
- name: Create release
if: steps.version-metadata.outputs.changed == 'true'
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
with:
generate_release_notes: true
tag_name: v${{ steps.version-metadata.outputs.newVersion }}
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,27 @@ jobs:
- run: |
python --version | Select-String "3.11"
shell: pixi run pwsh -Command {0}
pixi-shell-exec:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./
with:
run-install: false
- run: |
python --version | grep -q "3.11"
shell: pixi exec --spec python=3.11.* -- bash -e {0}
- run: |
import ruamel.yaml
shell: pixi exec --spec python --spec ruamel.yaml -- python {0}
- run: |
python --version | Select-String "3.11"
shell: pixi exec --spec python=3.11.* -- pwsh -Command {0}
post-cleanup-linux:
runs-on: ubuntu-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist
pnpm-lock.yaml
pnpm-lock.yaml
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m
```yml
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.24.1
pixi-version: v0.28.1
cache: true
auth-host: prefix.dev
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
Expand Down Expand Up @@ -229,6 +229,25 @@ If you want to use PowerShell, you need to specify `-Command` as well.
> There are some custom shells provided by GitHub that have slightly different behavior, see [`jobs.<job_id>.steps[*].shell`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell) in the documentation.
> See the [official documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#custom-shell) and [ADR 0277](https://github.com/actions/runner/blob/main/docs/adrs/0277-run-action-shell-options.md) for more information about how the `shell:` input works in GitHub Actions.

#### One-off shell wrapper using `pixi exec`

With `pixi exec`, you can also run a one-off command inside a temporary pixi environment.

```yml
- run: | # everything here will be run inside of the temporary pixi environment
zstd --version
shell: pixi exec --spec zstd -- bash -e {0}
```

```yml
- run: | # everything here will be run inside of the temporary pixi environment
import ruamel.yaml
# ...
shell: pixi exec --spec python=3.11.* --spec ruamel.yaml -- python {0}
```

See [here](https://pixi.sh/latest/reference/cli#exec) for more information about `pixi exec`.

### Environment activation

Instead of using a custom shell wrapper, you can also make all pixi-installed binaries available to subsequent steps by "activating" the installed environment in the currently running job.
Expand Down
33 changes: 7 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 80b340d

Please sign in to comment.