Compare commits

...
18 Commits
Author SHA1 Message Date
Pavel Zwerschke c3e865a194 ? 2023-11-16 01:21:32 +01:00
Pavel Zwerschke 5b18bdc1e0 ACTIONS_RUNNER_DEBUG 2023-11-16 01:16:31 +01:00
Pavel Zwerschke 907eb83951 Add debug test 2023-11-16 01:14:04 +01:00
Pavel Zwerschke 2023b09192 Add docs for cache-write (#38) 2023-11-16 00:12:40 +00:00
Pavel Zwerschke 4bb84de5dd Reference latest setup-pixi version in README (#37) 2023-11-16 00:03:57 +00:00
Pavel Zwerschke ccc5c07ed9 Add env path to cache key (#36) 2023-11-14 20:11:14 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 69d34221c7 Bump the dev-dependencies group with 5 updates (#34)
Bumps the dev-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `20.8.10` | `20.9.0` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `6.9.1` | `6.10.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `6.9.1` | `6.10.0` |
| [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) | `16.2.0` | `16.3.1` |
| [prettier](https://github.com/prettier/prettier) | `3.0.3` | `3.1.0` |


Updates `@types/node` from 20.8.10 to 20.9.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 6.9.1 to 6.10.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.10.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.9.1 to 6.10.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.10.0/packages/parser)

Updates `eslint-plugin-n` from 16.2.0 to 16.3.1
- [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases)
- [Commits](https://github.com/eslint-community/eslint-plugin-n/compare/16.2.0...16.3.1)

Updates `prettier` from 3.0.3 to 3.1.0
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.0)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: eslint-plugin-n
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 11:30:34 +00:00
Pavel Zwerschke f5fc2c8748 Enable cache by default (#33) 2023-11-09 15:55:30 +00:00
Pavel Zwerschke b4f12ad354 Remove pixiRunShell variable (#32) 2023-11-09 15:22:45 +00:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> cc9010b767 Bump the dev-dependencies group with 4 updates (#31)
Bumps the dev-dependencies group with 4 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [eslint](https://github.com/eslint/eslint).


Updates `@types/node` from 20.8.9 to 20.8.10
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 6.9.0 to 6.9.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.9.0 to 6.9.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.9.1/packages/parser)

Updates `eslint` from 8.52.0 to 8.53.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.52.0...v8.53.0)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 10:10:23 +01:00
dependabot[bot] ed6036947b Bump the dev-dependencies group with 4 updates (#29) 2023-10-30 08:45:08 +00:00
dependabot[bot] 28e30101b7 Bump actions/setup-node from 3 to 4 (#30) 2023-10-30 09:38:05 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 557d81653f Bump the dev-dependencies group with 4 updates (#28)
Bumps the dev-dependencies group with 4 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [eslint](https://github.com/eslint/eslint).


Updates `@types/node` from 20.8.6 to 20.8.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 6.7.5 to 6.8.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.8.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.7.5 to 6.8.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.8.0/packages/parser)

Updates `eslint` from 8.51.0 to 8.52.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.51.0...v8.52.0)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 11:16:43 +02:00
Pavel Zwerschke a784a3155d Fix typo (#27) 2023-10-17 20:20:48 +00:00
Pavel Zwerschke f19fc8f1fd Add comment about pixi-bin-path for self-hosted (#26) 2023-10-17 16:35:32 +00:00
dependabot[bot] b6cda42ffe Bump the dev-dependencies group with 5 updates (#24) 2023-10-16 09:02:55 +02:00
dependabot[bot]dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Pavel Zwerschke
5eaef48d51 Bump zod from 3.22.2 to 3.22.4 (#23)
* Bump zod from 3.22.2 to 3.22.4

Bumps [zod](https://github.com/colinhacks/zod) from 3.22.2 to 3.22.4.
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Changelog](https://github.com/colinhacks/zod/blob/master/CHANGELOG.md)
- [Commits](https://github.com/colinhacks/zod/compare/v3.22.2...v3.22.4)

---
updated-dependencies:
- dependency-name: zod
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pavel Zwerschke <pavelzw@gmail.com>
2023-10-09 08:04:41 +00:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> fbf0d0d598 Bump the dev-dependencies group with 4 updates (#22)
Bumps the dev-dependencies group with 4 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [eslint](https://github.com/eslint/eslint).


Updates `@types/node` from 20.8.2 to 20.8.3
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 6.7.3 to 6.7.4
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.4/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 6.7.3 to 6.7.4
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.4/packages/parser)

Updates `eslint` from 8.50.0 to 8.51.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.50.0...v8.51.0)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 07:54:59 +00:00
10 changed files with 584 additions and 428 deletions
+17 -1
View File
@@ -19,7 +19,7 @@ jobs:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
@@ -32,3 +32,19 @@ jobs:
- name: Lint
run: pnpm lint
reference-latest-version-in-readme:
name: Reference latest version in README
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Assert latest setup-pixi version is mentioned in README
run: |
latest_version="$(jq -r '.version' package.json)"
count_expected=10
count_actual="$(grep -c "setup-pixi@v$latest_version" README.md || true)"
if [ "$count_actual" -ne "$count_expected" ]; then
echo "::error file=README.md::Expected $count_expected mentions of setup-pixi@v$latest_version in README.md, but found $count_actual."
exit 1
fi
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
+38
View File
@@ -12,12 +12,17 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
cache: [true, false]
runs-on: ${{ matrix.os }}
name: default ${{ matrix.cache == true && 'with' || 'without' }} cache (${{ matrix.os }})
steps:
- uses: actions/checkout@v4
- name: Move pixi.toml
run: mv test/default/* .
- uses: ./
# check the action logs to see if the cache was used or not
with:
cache: ${{ matrix.cache }}
- run: |
set -o pipefail
pixi info
@@ -48,6 +53,7 @@ jobs:
- uses: ./
with:
run-install: false
cache: false
- run: |
! test -d .pixi
shell: bash
@@ -63,6 +69,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
pixi-version: v0.1.0
# pixi 0.1.0 doesn't support --locked
locked: false
@@ -79,6 +86,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
frozen: true
- run: pixi run python --version | grep -q 3.11
@@ -93,6 +101,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
locked: true
- run: pixi run python --version | grep -q 3.11
@@ -104,6 +113,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
pixi-url: https://github.com/prefix-dev/pixi/releases/download/v0.0.8/pixi-x86_64-unknown-linux-musl
# pixi 0.0.8 doesn't support --locked
locked: false
@@ -118,6 +128,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./
with:
cache: false
manifest-path: test/default/pixi.toml
different-log-level:
@@ -131,6 +142,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
log-level: v
custom-bin-path:
@@ -144,6 +156,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
pixi-bin-path: custom-bin/pixi${{ matrix.os == 'windows-latest' && '.exe' || '' }}
- run: |
test -f custom-bin/pixi${{ matrix.os == 'windows-latest' && '.exe' || '' }}
@@ -163,6 +176,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
auth-host: https://custom-conda-registry.com
auth-token: custom-token
- run: |
@@ -184,6 +198,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
auth-host: https://custom-conda-registry.com
auth-username: custom-username
auth-password: custom-password
@@ -207,6 +222,7 @@ jobs:
run: mv test/default/* .
- uses: ./
with:
cache: false
auth-host: https://custom-conda-registry.com
auth-conda-token: custom-conda-token
- run: |
@@ -229,6 +245,7 @@ jobs:
run: mv test/auth/* .
- uses: ./
with:
cache: false
auth-host: https://repo.prefix.dev
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
- name: Ensure private-package is installed
@@ -245,6 +262,8 @@ jobs:
- name: Move pixi.toml
run: mv test/default/* .
- uses: ./
with:
cache: false
- run: |
python --version | grep -q "3.11"
shell: pixi run bash {0}
@@ -273,6 +292,7 @@ jobs:
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
- uses: ./
with:
cache: false
post-cleanup: ${{ matrix.post-cleanup }}
# ~/.rattler is only created if the user has logged in
auth-host: https://custom-conda-registry.com
@@ -297,6 +317,7 @@ jobs:
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
- uses: ./
with:
cache: false
post-cleanup: ${{ matrix.post-cleanup }}
post-cleanup-macos:
@@ -317,6 +338,7 @@ jobs:
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
- uses: ./
with:
cache: false
post-cleanup: ${{ matrix.post-cleanup }}
post-cleanup-windows:
@@ -337,6 +359,7 @@ jobs:
${{ matrix.post-cleanup == 'true' && '! ' || '' }}test -f ~/.pixi/bin/pixi
- uses: ./
with:
cache: false
post-cleanup: ${{ matrix.post-cleanup }}
no-lockfile:
@@ -367,6 +390,21 @@ jobs:
pixi run python --version | grep -q 3.11
pixi run test | grep -q "Hello world"
debug:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Move pixi.toml
run: mv test/default/* .
# test that setup-pixi does debug logging
- uses: ./
env:
ACTIONS_STEP_DEBUG: true
- run: pixi run python --version | grep -q 3.11
test-cache1:
name: Test cache 1/2
timeout-minutes: 10
+34 -16
View File
@@ -23,9 +23,9 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m
## Usage
```yml
- uses: prefix-dev/setup-pixi@v0.3.0
- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.5.0
pixi-version: v0.7.0
cache: true
auth-host: prefix.dev
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
@@ -34,7 +34,7 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m
> [!WARNING]
> Since pixi is not yet stable, the API of this action may change between minor versions.
> Please pin the versions of this action to a specific version (i.e., `prefix-dev/setup-pixi@v0.3.0`) to avoid breaking changes.
> Please pin the versions of this action to a specific version (i.e., `prefix-dev/setup-pixi@v0.4.1`) to avoid breaking changes.
> You can automatically update the version of this action by using [Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot).
## Features
@@ -43,13 +43,27 @@ To see all available input arguments, see the [`action.yml`](action.yml) file.
### Caching
The action supports caching of the pixi environment. To enable caching, set `cache: true`.
The action supports caching of the pixi environment.
By default, caching is enabled if a `pixi.lock` file is present.
It will then use the `pixi.lock` file to generate a hash of the environment and cache it.
If the cache is hit, the action will skip the installation and use the cached environment.
You can specify the behavior by setting the `cache` input argument.
If you need to customize your cache-key, you can use the `cache-key` input argument.
This will be the prefix of the cache key. The full cache key will be `<cache-key><conda-arch>-<hash>`.
#### Only save caches on `main`
In order to not exceed the [10 GB cache size limit](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy) as fast, you might want to restrict when the cache is saved.
This can be done by setting the `cache-write` argument.
```yml
- uses: prefix-dev/setup-pixi@v0.4.1
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
```
### Authentication
There are currently three ways to authenticate with pixi:
@@ -71,7 +85,7 @@ Specify the token using the `auth-token` input argument.
This form of authentication (bearer token in the request headers) is mainly used at [prefix.dev](https://prefix.dev).
```yml
- uses: prefix-dev/setup-pixi@v0.3.0
- uses: prefix-dev/setup-pixi@v0.4.1
with:
auth-host: prefix.dev
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
@@ -83,7 +97,7 @@ Specify the username and password using the `auth-username` and `auth-password`
This form of authentication (HTTP Basic Auth) is used in some enterprise environments with [artifactory](https://jfrog.com/artifactory) for example.
```yml
- uses: prefix-dev/setup-pixi@v0.3.0
- uses: prefix-dev/setup-pixi@v0.4.1
with:
auth-host: custom-artifactory.com
auth-username: ${{ secrets.PIXI_USERNAME }}
@@ -96,7 +110,7 @@ Specify the conda-token using the `conda-token` input argument.
This form of authentication (token is encoded in URL: `https://my-quetz-instance.com/t/<token>/get/custom-channel`) is used at [anaconda.org](https://anaconda.org) or with [quetz instances](https://github.com/mamba-org/quetz).
```yml
- uses: prefix-dev/setup-pixi@v0.3.0
- uses: prefix-dev/setup-pixi@v0.4.1
with:
auth-host: anaconda.org # or my-quetz-instance.com
conda-token: ${{ secrets.CONDA_TOKEN }}
@@ -134,7 +148,7 @@ You can specify whether `setup-pixi` should run `pixi install --frozen` or `pixi
See the [official documentation](https://prefix.dev/docs/pixi/cli#install) for more information about the `--frozen` and `--locked` flags.
```yml
- uses: prefix-dev/setup-pixi@v0.3.0
- uses: prefix-dev/setup-pixi@v0.4.1
with:
locked: true
# or
@@ -150,12 +164,12 @@ There are two types of debug logging that you can enable.
#### Debug logging of the action
The first one is the debug logging of the action itself.
This can be enabled by running the action with the `RUNNER_DEBUG` environment variable set to `true`.
This can be enabled by running the action with the `ACTIONS_RUNNER_DEBUG` environment variable set to `true`.
```yml
- uses: prefix-dev/setup-pixi@v0.3.0
- uses: prefix-dev/setup-pixi@v0.4.1
env:
RUNNER_DEBUG: true
ACTIONS_RUNNER_DEBUG: true
```
Alternatively, you can enable debug logging for the action by re-running the action in debug mode:
@@ -171,7 +185,7 @@ The second type is the debug logging of the pixi executable.
This can be specified by setting the `log-level` input.
```yml
- uses: prefix-dev/setup-pixi@v0.3.0
- uses: prefix-dev/setup-pixi@v0.4.1
with:
# one of `q`, `default`, `v`, `vv`, or `vvv`.
log-level: vvv
@@ -179,9 +193,9 @@ This can be specified by setting the `log-level` input.
If nothing is specified, `setup-pixi` will default to `default` or `vv` depending on if [debug logging is enabled for the action](#debug-logging-of-the-action).
### Post action cleanup
### Self-hosted runners
On self hosted runners, it may happen that some files are persisted between jobs.
On self-hosted runners, it may happen that some files are persisted between jobs.
This can lead to problems or secrets getting leaked between job runs.
To avoid this, you can use the `post-cleanup` input to specify the post cleanup behavior of the action (i.e., what happens _after_ all your commands have been executed).
@@ -194,10 +208,14 @@ If you set `post-cleanup` to `true`, the action will delete the following files:
If nothing is specified, `setup-pixi` will default to `true`.
On self-hosted runners, you also might want to alter the default pixi install location to a temporary location. You can use `pixi-bin-path: ${{ runner.temp }}/bin/pixi` to do this.
```yml
- uses: prefix-dev/setup-pixi@v0.3.0
- uses: prefix-dev/setup-pixi@v0.4.1
with:
post-cleanup: false
post-cleanup: true
# ${{ runner.temp }}\Scripts\pixi.exe on Windows
pixi-bin-path: ${{ runner.temp }}/bin/pixi
```
## More examples
Generated Vendored
+49 -31
View File
@@ -57388,7 +57388,7 @@ var import_process = require("process");
var import_fs = require("fs");
var core = __toESM(require_core());
// node_modules/.pnpm/zod@3.22.2/node_modules/zod/lib/index.mjs
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
var util;
(function(util4) {
util4.assertEqual = (val) => val;
@@ -58129,10 +58129,11 @@ var ZodType = class {
};
var cuidRegex = /^c[^\s-]{8,}$/i;
var cuid2Regex = /^[a-z][a-z0-9]*$/;
var ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
var emailRegex = /^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
var emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u;
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
var emojiRegex;
var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
var datetimeRegex = (args) => {
@@ -58166,27 +58167,6 @@ function isValidIP(ip, version3) {
return false;
}
var ZodString = class _ZodString extends ZodType {
constructor() {
super(...arguments);
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
validation,
code: ZodIssueCode.invalid_string,
...errorUtil.errToObj(message)
});
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
this.trim = () => new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "trim" }]
});
this.toLowerCase = () => new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toLowerCase" }]
});
this.toUpperCase = () => new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toUpperCase" }]
});
}
_parse(input) {
if (this._def.coerce) {
input.data = String(input.data);
@@ -58271,6 +58251,9 @@ var ZodString = class _ZodString extends ZodType {
status.dirty();
}
} else if (check.kind === "emoji") {
if (!emojiRegex) {
emojiRegex = new RegExp(_emojiRegex, "u");
}
if (!emojiRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
@@ -58407,6 +58390,13 @@ var ZodString = class _ZodString extends ZodType {
}
return { status: status.value, value: input.data };
}
_regex(regex, validation, message) {
return this.refinement((data) => regex.test(data), {
validation,
code: ZodIssueCode.invalid_string,
...errorUtil.errToObj(message)
});
}
_addCheck(check) {
return new _ZodString({
...this._def,
@@ -58504,6 +58494,31 @@ var ZodString = class _ZodString extends ZodType {
...errorUtil.errToObj(message)
});
}
/**
* @deprecated Use z.string().min(1) instead.
* @see {@link ZodString.min}
*/
nonempty(message) {
return this.min(1, errorUtil.errToObj(message));
}
trim() {
return new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "trim" }]
});
}
toLowerCase() {
return new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toLowerCase" }]
});
}
toUpperCase() {
return new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toUpperCase" }]
});
}
get isDatetime() {
return !!this._def.checks.find((ch) => ch.kind === "datetime");
}
@@ -61034,12 +61049,11 @@ var inferOptions = (inputs) => {
const logLevel = inputs.logLevel ?? (core.isDebug() ? "vv" : "default");
const manifestPath = inputs.manifestPath ? import_path.default.resolve(untildify(inputs.manifestPath)) : "pixi.toml";
const pixiLockFile = import_path.default.join(import_path.default.dirname(manifestPath), import_path.default.basename(manifestPath).replace(/\.toml$/, ".lock"));
const cache2 = inputs.cacheKey ? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true } : inputs.cache ? { cacheKeyPrefix: "pixi-", cacheWrite: true } : void 0;
const pixiBinPath = inputs.pixiBinPath ? import_path.default.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin;
const pixiRunShell = import_path.default.join(import_path.default.dirname(pixiBinPath), "pixi-shell");
const frozen = inputs.frozen ?? false;
const lockFileAvailable = (0, import_fs.existsSync)(pixiLockFile);
core.debug(`lockFileAvailable: ${lockFileAvailable}`);
const cache2 = inputs.cacheKey ? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true } : inputs.cache === true || lockFileAvailable && inputs.cache !== false ? { cacheKeyPrefix: "pixi-", cacheWrite: true } : void 0;
const pixiBinPath = inputs.pixiBinPath ? import_path.default.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin;
const frozen = inputs.frozen ?? false;
const locked = inputs.locked ?? (lockFileAvailable && !frozen);
const auth = !inputs.authHost ? void 0 : inputs.authToken ? {
host: inputs.authHost,
@@ -61063,7 +61077,6 @@ var inferOptions = (inputs) => {
locked,
cache: cache2,
pixiBinPath,
pixiRunShell,
auth,
postCleanup
};
@@ -61215,7 +61228,12 @@ var import_promises = __toESM(require("fs/promises"));
var import_path2 = __toESM(require("path"));
var core3 = __toESM(require_core());
var cache = __toESM(require_cache());
var generateCacheKey = async (cacheKeyPrefix) => import_promises.default.readFile(options.pixiLockFile, "utf-8").then((content) => `${cacheKeyPrefix}${getCondaArch()}-${sha256(content)}`).catch((err) => {
var generateCacheKey = async (cacheKeyPrefix) => import_promises.default.readFile(options.pixiLockFile, "utf-8").then((content) => {
const contentsSha = sha256(content);
const lockFileSha = sha256(options.pixiLockFile);
const sha = sha256(contentsSha + lockFileSha);
return `${cacheKeyPrefix}${getCondaArch()}-${sha}`;
}).catch((err) => {
throw new Error(`Failed to generate cache key: ${err}`);
});
var cachePath = import_path2.default.join(import_path2.default.dirname(options.pixiLockFile), ".pixi");
Generated Vendored
+43 -30
View File
@@ -2255,7 +2255,7 @@ var import_process = require("process");
var import_fs = require("fs");
var core = __toESM(require_core());
// node_modules/.pnpm/zod@3.22.2/node_modules/zod/lib/index.mjs
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
var util;
(function(util2) {
util2.assertEqual = (val) => val;
@@ -2996,10 +2996,11 @@ var ZodType = class {
};
var cuidRegex = /^c[^\s-]{8,}$/i;
var cuid2Regex = /^[a-z][a-z0-9]*$/;
var ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;
var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
var emailRegex = /^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
var emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u;
var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
var emojiRegex;
var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
var datetimeRegex = (args) => {
@@ -3033,27 +3034,6 @@ function isValidIP(ip, version2) {
return false;
}
var ZodString = class _ZodString extends ZodType {
constructor() {
super(...arguments);
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
validation,
code: ZodIssueCode.invalid_string,
...errorUtil.errToObj(message)
});
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
this.trim = () => new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "trim" }]
});
this.toLowerCase = () => new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toLowerCase" }]
});
this.toUpperCase = () => new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toUpperCase" }]
});
}
_parse(input) {
if (this._def.coerce) {
input.data = String(input.data);
@@ -3138,6 +3118,9 @@ var ZodString = class _ZodString extends ZodType {
status.dirty();
}
} else if (check.kind === "emoji") {
if (!emojiRegex) {
emojiRegex = new RegExp(_emojiRegex, "u");
}
if (!emojiRegex.test(input.data)) {
ctx = this._getOrReturnCtx(input, ctx);
addIssueToContext(ctx, {
@@ -3274,6 +3257,13 @@ var ZodString = class _ZodString extends ZodType {
}
return { status: status.value, value: input.data };
}
_regex(regex, validation, message) {
return this.refinement((data) => regex.test(data), {
validation,
code: ZodIssueCode.invalid_string,
...errorUtil.errToObj(message)
});
}
_addCheck(check) {
return new _ZodString({
...this._def,
@@ -3371,6 +3361,31 @@ var ZodString = class _ZodString extends ZodType {
...errorUtil.errToObj(message)
});
}
/**
* @deprecated Use z.string().min(1) instead.
* @see {@link ZodString.min}
*/
nonempty(message) {
return this.min(1, errorUtil.errToObj(message));
}
trim() {
return new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "trim" }]
});
}
toLowerCase() {
return new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toLowerCase" }]
});
}
toUpperCase() {
return new _ZodString({
...this._def,
checks: [...this._def.checks, { kind: "toUpperCase" }]
});
}
get isDatetime() {
return !!this._def.checks.find((ch) => ch.kind === "datetime");
}
@@ -5901,12 +5916,11 @@ var inferOptions = (inputs) => {
const logLevel = inputs.logLevel ?? (core.isDebug() ? "vv" : "default");
const manifestPath = inputs.manifestPath ? import_path.default.resolve(untildify(inputs.manifestPath)) : "pixi.toml";
const pixiLockFile = import_path.default.join(import_path.default.dirname(manifestPath), import_path.default.basename(manifestPath).replace(/\.toml$/, ".lock"));
const cache = inputs.cacheKey ? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true } : inputs.cache ? { cacheKeyPrefix: "pixi-", cacheWrite: true } : void 0;
const pixiBinPath = inputs.pixiBinPath ? import_path.default.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin;
const pixiRunShell = import_path.default.join(import_path.default.dirname(pixiBinPath), "pixi-shell");
const frozen = inputs.frozen ?? false;
const lockFileAvailable = (0, import_fs.existsSync)(pixiLockFile);
core.debug(`lockFileAvailable: ${lockFileAvailable}`);
const cache = inputs.cacheKey ? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true } : inputs.cache === true || lockFileAvailable && inputs.cache !== false ? { cacheKeyPrefix: "pixi-", cacheWrite: true } : void 0;
const pixiBinPath = inputs.pixiBinPath ? import_path.default.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin;
const frozen = inputs.frozen ?? false;
const locked = inputs.locked ?? (lockFileAvailable && !frozen);
const auth = !inputs.authHost ? void 0 : inputs.authToken ? {
host: inputs.authHost,
@@ -5930,7 +5944,6 @@ var inferOptions = (inputs) => {
locked,
cache,
pixiBinPath,
pixiRunShell,
auth,
postCleanup
};
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "setup-pixi",
"version": "0.3.0",
"version": "0.4.1",
"private": true,
"description": "Action to set up the pixi package manager.",
"scripts": {
@@ -27,20 +27,20 @@
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1",
"untildify": "^5.0.0",
"zod": "^3.22.2"
"zod": "^3.22.4"
},
"devDependencies": {
"@types/node": "^20.8.2",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"eslint": "^8.50.0",
"@types/node": "^20.9.0",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-promise": "^6.1.1",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
}
+366 -317
View File
File diff suppressed because it is too large Load Diff
+8 -1
View File
@@ -8,7 +8,14 @@ import { getCondaArch, sha256 } from './util'
export const generateCacheKey = async (cacheKeyPrefix: string) =>
fs
.readFile(options.pixiLockFile, 'utf-8')
.then((content) => `${cacheKeyPrefix}${getCondaArch()}-${sha256(content)}`)
.then((content) => {
const contentsSha = sha256(content)
// the path to the lock file decides where the pixi env is created (../.pixi/env)
// since conda envs are not relocatable, we need to include the path in the cache key
const lockFileSha = sha256(options.pixiLockFile)
const sha = sha256(contentsSha + lockFileSha)
return `${cacheKeyPrefix}${getCondaArch()}-${sha}`
})
.catch((err) => {
throw new Error(`Failed to generate cache key: ${err}`)
})
+18 -21
View File
@@ -64,7 +64,6 @@ export type Options = Readonly<{
locked: boolean
cache?: Cache
pixiBinPath: string
pixiRunShell: string
auth?: Auth
postCleanup: boolean
}>
@@ -150,21 +149,20 @@ const inferOptions = (inputs: Inputs): Options => {
const pixiSource = inputs.pixiVersion
? { version: inputs.pixiVersion }
: inputs.pixiUrl
? { url: inputs.pixiUrl }
: { version: 'latest' }
? { url: inputs.pixiUrl }
: { version: 'latest' }
const logLevel = inputs.logLevel ?? (core.isDebug() ? 'vv' : 'default')
const manifestPath = inputs.manifestPath ? path.resolve(untildify(inputs.manifestPath)) : 'pixi.toml'
const pixiLockFile = path.join(path.dirname(manifestPath), path.basename(manifestPath).replace(/\.toml$/, '.lock'))
const cache = inputs.cacheKey
? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true }
: inputs.cache
? { cacheKeyPrefix: 'pixi-', cacheWrite: true }
: undefined
const pixiBinPath = inputs.pixiBinPath ? path.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin
const pixiRunShell = path.join(path.dirname(pixiBinPath), 'pixi-shell')
const frozen = inputs.frozen ?? false
const lockFileAvailable = existsSync(pixiLockFile)
core.debug(`lockFileAvailable: ${lockFileAvailable}`)
const cache = inputs.cacheKey
? { cacheKeyPrefix: inputs.cacheKey, cacheWrite: inputs.cacheWrite ?? true }
: inputs.cache === true || (lockFileAvailable && inputs.cache !== false)
? { cacheKeyPrefix: 'pixi-', cacheWrite: true }
: undefined
const pixiBinPath = inputs.pixiBinPath ? path.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin
const frozen = inputs.frozen ?? false
const locked = inputs.locked ?? (lockFileAvailable && !frozen)
const auth = !inputs.authHost
? undefined
@@ -174,15 +172,15 @@ const inferOptions = (inputs: Inputs): Options => {
token: inputs.authToken
}
: inputs.authCondaToken
? {
host: inputs.authHost,
condaToken: inputs.authCondaToken
}
: {
host: inputs.authHost,
username: inputs.authUsername!,
password: inputs.authPassword!
}) as Auth)
? {
host: inputs.authHost,
condaToken: inputs.authCondaToken
}
: {
host: inputs.authHost,
username: inputs.authUsername!,
password: inputs.authPassword!
}) as Auth)
const postCleanup = inputs.postCleanup ?? true
return {
pixiSource,
@@ -194,7 +192,6 @@ const inferOptions = (inputs: Inputs): Options => {
locked,
cache,
pixiBinPath,
pixiRunShell,
auth,
postCleanup
}