Skip to content

Commit

Permalink
reorder readme
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed Dec 8, 2023
1 parent 351303b commit 0391891
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ are used. For available software, [see here](https://github.com/spack/github-act

These binaries are unsigned, so you have to specify `install --no-check-signature`.

## Example: shell support

If you want to use shell-aware commands such as `spack env activate` and `spack load`,
use either `shell: spack-bash {0}` or `shell: spack-sh {0}` in your action:

```yaml
- name: Shell example
shell: spack-bash {0}
run: |
spack env activate .
spack env status
```

These "shells" are small wrappers that run `. setup-env.sh` before executing your script.

## Example: caching your own binaries for public repositories

When you need to install packages not available in the default build cache, you can build them
Expand All @@ -35,7 +50,7 @@ repository:

```yaml
spack:
view: my_view
view: view
specs:
- [email protected]
Expand Down Expand Up @@ -71,7 +86,10 @@ jobs:
run: spack -e . install --no-check-signature
- name: Run
run: ./my_view/bin/python3 -c 'print("hello world")'
shell: spack-bash
run: |
spack env activate .
python3 -c 'print("hello world")'
- name: Push packages and update index
run: |
Expand Down Expand Up @@ -108,22 +126,6 @@ From a security perspective, notice that the `GITHUB_TOKEN` is exposed to every
subsequent job step. (This is no different from `docker login`, which also likes
to store credentials in the home directory.)


## Example: shell support

If you want to use shell-aware commands such as `spack env activate` and `spack load`,
use either `shell: spack-bash {0}` or `shell: spack-sh {0}` in your action:

```yaml
- name: Shell example
shell: spack-bash {0}
run: |
spack env activate .
spack env status
```

These "shells" are small wrappers that run `. setup-env.sh` before executing your script.

## License

This project is part of Spack. Spack is distributed under the terms of both the
Expand Down

0 comments on commit 0391891

Please sign in to comment.