Skip to content

Commit

Permalink
Add basic functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Sep 3, 2023
1 parent fbf149e commit d163eb7
Show file tree
Hide file tree
Showing 9 changed files with 59,769 additions and 300 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Rebuild the dist/ directory
run: pnpm build

- name: Lint
run: pnpm lint
2 changes: 1 addition & 1 deletion .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: pnpm

- name: Install dependencies
Expand Down
116 changes: 38 additions & 78 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,90 +6,50 @@ branding:
color: yellow

inputs:
condarc-file:
description: |
Path to a condarc file to use
condarc:
description: |
Contents of a condarc file to use.
environment-file:
description: |
Path to the `environment.yml` or `.lock` file for the environment.
environment-name:
description: |
Name of the environment to create. Overrides the name in the environment file.
create-args:
description: |
Extra arguments to pass to `micromamba create`.
Also possible to list extra specs to install into the environment.
For multiple packages, separate using spaces or use multiline syntax:
```yml
create-args: package1 package2
# or
create-args: >-
package1
package2
```
pixi-version:
description: Version of pixi to install
pixi-url:
description: URL of pixi to install
log-level:
description: |
Log level for micromamba.
One of `'trace'`, `'debug'`, `'info'`, `'warning'`, `'error'`, `'critical'`, `'off'`.
micromamba-version:
description: |
Version of micromamba to install.
Must match with a micromamba version from the https://github.com/mamba-org/micromamba-releases repository or 'latest'.
micromamba-url:
description: |
URL to download micromamba from.
init-shell:
description: |
Which shells to initialize micromamba in.
Also possible to list multiple shells using spaces or use multiline syntax:
```yml
init-shell: bash cmd.exe powershell
# or
init-shell: >-
bash
cmd.exe
powershell
```
To initialize no shell, use `'none'`.
Also supports other shells than bash, cmd.exe and powershell, but they are not tested.
Log level for the pixi CLI.
One of `quiet`, `warn`, `info`, `debug`, or `trace`.
manifest-path:
description: Path to the manifest file (i.e., `pixi.toml`) to use for the pixi CLI. Defaults to `pixi.toml`.
run-install:
description: Whether to run `pixi install` after setting up the environment. Defaults to `true`.
generate-run-shell:
description: |
Whether to generate a custom shell script that allows to use it in the workflow file using `run: micromamba-shell {0}`
cache-downloads:
description: |
Whether to cache downloads or not.
cache-downloads-key:
description: |
Cache key to use for caching.
cache-environment:
description: |
Whether to cache the environment or not.
cache-environment-key:
description: |
Cache key to use for caching.
Whether to generate a custom shell script that allows to use it in the workflow file using `run: pixi-shell {0}`.
cache:
description: Whether to cache the pixi environment. Defaults to `true`. Only works if `pixi.lock` is present.
cache-key:
description: |
Cache key prefix to use for caching the pixi environment.
Defaults to `pixi-{conda-arch}`.
pixi-bin-path:
description: |
Path to the pixi binary to use. Defaults to `~/.pixi/bin/pixi`.
auth-host:
description: |
Host to use for authentication. If not set, pixi is not authenticating.
Requires `auth-token` or `auth-conda-token` or `auth-username` and `auth-password` to be set.
See https://prefix.dev/docs/pixi/authentication
auth-token:
description: Token to use for authentication.
auth-username:
description: Username to use for authentication.
auth-password:
description: Password to use for authentication.
auth-conda-token:
description: Conda token to use for authentication.
post-cleanup:
description: |
Which kind of cleanup to do after the action.
`'none'` - do not cleanup anything.
`'shell-init'` - cleanup only the shell initialization scripts.
`'environment'` - cleanup the installed environment and shell initialization scripts.
`'all'` - cleanup everything including the whole micromamba root folder and the micromamba binary.
micromamba-root-path:
description: |
Path to the micromamba root folder.
Defaults to `~/micromamba`.
micromamba-binary-path:
description: |
Path to the micromamba binary.
Defaults to `~/micromamba-bin/micromamba`.
Also specifies the path to the custom condarc which is located in the same folder as the micromamba binary.
outputs:
environment-path:
description: Path to the created environment. Only populated if environment was created, i.e., `environment-file` or `environment-name` was specified.
What kind of cleanup the action should do in the post step.
One of `none`, `environment` or `all`.
If `none`, no cleanup is done.
If `environment`, the pixi environment is removed.
If `all`, the pixi environment, the pixi CLI are removed and the rattler cache is cleared.
runs:
using: node20
Expand Down
Loading

0 comments on commit d163eb7

Please sign in to comment.