mirror of
https://github.com/prefix-dev/setup-pixi
synced 2026-10-08 15:04:08 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ccc5c07ed9 | ||
|
|
69d34221c7 | ||
|
|
f5fc2c8748 | ||
|
|
b4f12ad354 | ||
|
|
cc9010b767 | ||
|
|
ed6036947b | ||
|
|
28e30101b7 | ||
|
|
557d81653f | ||
|
|
a784a3155d | ||
|
|
f19fc8f1fd | ||
|
|
b6cda42ffe | ||
|
|
5eaef48d51 | ||
|
|
fbf0d0d598 |
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -43,9 +43,11 @@ 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>`.
|
||||
@@ -179,9 +181,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 +196,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
|
||||
with:
|
||||
post-cleanup: false
|
||||
post-cleanup: true
|
||||
# ${{ runner.temp }}\Scripts\pixi.exe on Windows
|
||||
pixi-bin-path: ${{ runner.temp }}/bin/pixi
|
||||
```
|
||||
|
||||
## More examples
|
||||
|
||||
+49
-31
@@ -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");
|
||||
|
||||
+43
-30
@@ -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
@@ -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"
|
||||
}
|
||||
|
||||
Generated
+366
-317
File diff suppressed because it is too large
Load Diff
+8
-1
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user