Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Oct 3, 2023
1 parent a9284d6 commit 2837d0f
Show file tree
Hide file tree
Showing 7 changed files with 1,227 additions and 367 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ jobs:
# - run: exit 1
# if: success()

test-locked-out-of-date:
test-lockfile-not-up-to-date:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -541,9 +541,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Move pixi files
run: mv test/lockfile-out-of-date/* .
run: mv test/lockfile-not-up-to-date/* .
- uses: ./
with:
locked: true
# locked: true is implicit
- run: exit 1
if: success()
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ You can even run python scripts like this:
### `--frozen` and `--locked`

You can specify whether `setup-pixi` should run `pixi install --frozen` or `pixi install --locked` depending on the `frozen` or the `locked` input argument.
See the [official documentation](https://prefix.dev/docs/pixi/cli#install) for more information about the `--frozen` and `--locked` flags.

```yml
- uses: prefix-dev/[email protected]
with:
frozen: true
# or
# locked will result in your CI failing if the lockfile is not up to date
locked: true
# or
frozen: true
```

If you don't specify anything, the default behavior is to run `pixi install --frozen` if a `pixi.lock` file is present and `pixi install` otherwise.
If you don't specify anything, the default behavior is to run `pixi install --locked` if a `pixi.lock` file is present and `pixi install` otherwise.

### Debugging

Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ inputs:
run-install:
description: Whether to run `pixi install` after setting up the environment. Defaults to `true`.
locked:
description: Whether to use `pixi install --locked`. Defaults to `false`.
description: Whether to use `pixi install --locked`. Defaults to `true` when the lockfile is present, otherwise `false`.
frozen:
description: Whether to use `pixi install --frozen`. Defaults to `true` when the lockfile is present, otherwise `false`.
description: Whether to use `pixi install --frozen`. Defaults to `false`.
cache:
description: Whether to cache the pixi environment. Defaults to `true`. Only works if `pixi.lock` is present.
cache-key:
Expand Down
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ const inferOptions = (inputs: Inputs): Options => {
: undefined
const pixiBinPath = inputs.pixiBinPath ? path.resolve(untildify(inputs.pixiBinPath)) : PATHS.pixiBin
const pixiRunShell = path.join(path.dirname(pixiBinPath), 'pixi-shell')
const locked = inputs.locked ?? false
const frozen = inputs.frozen ?? false
const lockFileAvailable = existsSync(pixiLockFile)
const locked = inputs.locked ?? (lockFileAvailable && !frozen)
core.debug(`lockFileAvailable: ${lockFileAvailable}`)
const frozen = inputs.frozen ?? lockFileAvailable
const auth = !inputs.authHost
? undefined
: ((inputs.authToken
Expand Down
Loading

0 comments on commit 2837d0f

Please sign in to comment.