Make test.sh build example; also set -e

This commit is contained in:
Sridhar Ratnakumar 2023-06-09 14:29:38 -04:00
parent ea29723d37
commit a1fb056f11
2 changed files with 7 additions and 5 deletions

View File

@ -11,11 +11,6 @@ jobs:
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Build example flake
id: example
run: |
cd ./example
nix build -L --override-input process-compose-flake ..
- name: Run test
id: test
run: |

View File

@ -1,4 +1,11 @@
set -euxo pipefail
cd "$(dirname "$0")"
# First, build the example.
(cd ../example && nix build -L --override-input process-compose-flake ..)
# Then run the test.
rm -f ./data.sqlite
nix run -L --override-input process-compose-flake .. .
[[ $(cat result.txt) == "Hello" ]] && echo "Test passed" || (echo "Test failed" && exit 1)