From edb3f18b37b5f2ceef30744977d98f8d038e727e Mon Sep 17 00:00:00 2001 From: Emanuel Pargov Date: Wed, 11 Oct 2023 15:48:46 +0300 Subject: [PATCH] Feat: Add run examples task (#816) Signed-off-by: Emanuel Pargov --- Taskfile.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index 31bd9b62a..854b6dc36 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -35,3 +35,20 @@ tasks: "test:integration": cmds: - go test -tags="e2e" -v -timeout 9999s + run-examples: + cmds: + - | + for example in examples/*; do + if [ -d "$example" ]; then + pushd "$example" > /dev/null + if [ -f main.go ]; then + echo "Running $example/main.go" + go run main.go + if [ $? -ne 0 ]; then + echo "Error: $example/main.go failed" + exit 1 + fi + fi + popd > /dev/null + fi + done