From 03918912c4ab2bada4e968b1feb1f5cf3b39c819 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 8 Dec 2023 12:57:56 +0100 Subject: [PATCH] reorder readme --- README.md | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6a256b9..7a4f71e 100644 --- a/README.md +++ b/README.md @@ -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 @@ -35,7 +50,7 @@ repository: ```yaml spack: - view: my_view + view: view specs: - python@3.11 @@ -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: | @@ -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