mirror of
https://git.madhouse-project.org/actions/nix.git
synced 2025-05-09 21:59:53 +02:00
Add a nix/shell action
Since it's basically the same as `nix/develop`, with only the nix command changed, leverage the existing script. Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This commit is contained in:
parent
63e7eb4047
commit
18b41c0333
6 changed files with 109 additions and 1 deletions
39
.forgejo/workflows/nix-shell.yaml
Normal file
39
.forgejo/workflows/nix-shell.yaml
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
name: test nix/shell
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
nix/shell:
|
||||
runs-on: nixos-flakes
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: run a command within a Nix shell
|
||||
uses: ./shell
|
||||
with:
|
||||
flake: ./shell/test
|
||||
package: "hello"
|
||||
run: |
|
||||
hello
|
||||
|
||||
- name: ensure we're not in a dev environment
|
||||
uses: ./shell
|
||||
with:
|
||||
flake: ./shell/test
|
||||
package: "hello"
|
||||
run: |
|
||||
set -x
|
||||
|
||||
# if we have gcc installed, we're in a dev environment.
|
||||
# we don't want to be in a dev environment
|
||||
type -p gcc >/dev/null && exit 1
|
||||
hello
|
||||
|
||||
- name: no commands should still work
|
||||
uses: ./shell
|
||||
with:
|
||||
flake: ./shell/test
|
||||
package: "hello"
|
Loading…
Add table
Add a link
Reference in a new issue