2023-09-22 21:43:51 +02:00
|
|
|
---
|
|
|
|
name: test nix/shell
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-09-22 22:14:43 +02:00
|
|
|
paths:
|
|
|
|
- '.forgejo/workflows/nix-shell.yaml'
|
|
|
|
- 'develop/bin/nix-develop'
|
|
|
|
- 'build/**'
|
2023-09-22 21:43:51 +02:00
|
|
|
|
|
|
|
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"
|