2023-09-22 20:37:44 +02:00
|
|
|
---
|
|
|
|
name: test nix/develop
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-09-22 22:14:43 +02:00
|
|
|
paths:
|
|
|
|
- '.forgejo/workflows/nix-develop.yaml'
|
|
|
|
- 'develop/**'
|
2023-09-22 20:37:44 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
nix/develop:
|
|
|
|
runs-on: nixos-flakes
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: run a command within a dev environment
|
|
|
|
uses: ./develop
|
|
|
|
with:
|
|
|
|
flake: ./develop/test
|
|
|
|
package: "hello"
|
|
|
|
run: |
|
|
|
|
hello
|
|
|
|
|
|
|
|
- name: run multiple commands within a dev environment
|
|
|
|
uses: ./develop
|
|
|
|
with:
|
|
|
|
flake: ./develop/test
|
|
|
|
package: "hello"
|
|
|
|
run: |
|
|
|
|
gcc --version
|
|
|
|
hello
|
|
|
|
if [ -n "${CI}" ]; then
|
|
|
|
echo "I'm running in CI!"
|
|
|
|
fi
|
2023-09-22 21:28:07 +02:00
|
|
|
|
|
|
|
- name: no commands should still work
|
|
|
|
uses: ./develop
|
|
|
|
with:
|
|
|
|
flake: ./develop/test
|
|
|
|
package: "hello"
|
2023-09-22 21:56:05 +02:00
|
|
|
|
|
|
|
- name: errors within the script should propagate
|
|
|
|
id: error-check
|
|
|
|
continue-on-error: true
|
|
|
|
uses: ./develop
|
|
|
|
with:
|
|
|
|
flake: ./develop/test
|
|
|
|
package: "hello"
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
this-command-does-not-exist | cat
|
|
|
|
this-command-does-not-exist
|
|
|
|
|
|
|
|
- name: make sure the previous step failed
|
|
|
|
run: |
|
|
|
|
[ "${{ steps.error-check.outcome }}" = "failure" ]
|