From 0ba9facf9bd383ebbf761f64c75390f2bd129331 Mon Sep 17 00:00:00 2001 From: Cristian Oliveira Date: Mon, 22 May 2023 20:42:53 +0200 Subject: [PATCH] docs: adds more examples --- examples/list-of-commands-per-task.yaml | 4 ++++ examples/list-of-watches.yml | 5 +++++ examples/{multiple.yml => multiple-tasks.yml} | 4 +++- examples/piped.yml | 4 ---- tests/integration/specs/list-of-commands-task-test.sh | 4 ++-- 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 examples/list-of-commands-per-task.yaml create mode 100644 examples/list-of-watches.yml rename examples/{multiple.yml => multiple-tasks.yml} (65%) delete mode 100644 examples/piped.yml diff --git a/examples/list-of-commands-per-task.yaml b/examples/list-of-commands-per-task.yaml new file mode 100644 index 0000000..14e5f8f --- /dev/null +++ b/examples/list-of-commands-per-task.yaml @@ -0,0 +1,4 @@ +- name: run a list of commands + run: ["echo first", "echo second", "echo complex | sed s/complex/third/g"] + change: "src/**" + run_on_init: true diff --git a/examples/list-of-watches.yml b/examples/list-of-watches.yml new file mode 100644 index 0000000..c68dd24 --- /dev/null +++ b/examples/list-of-watches.yml @@ -0,0 +1,5 @@ +- name: run a list of watches + run: "echo complex | sed s/complex/third/g" + change: ["src/**", "tests/**"] + ignore: ["tests/integration/**"] + run_on_init: true diff --git a/examples/multiple.yml b/examples/multiple-tasks.yml similarity index 65% rename from examples/multiple.yml rename to examples/multiple-tasks.yml index 8482a0b..30978d1 100644 --- a/examples/multiple.yml +++ b/examples/multiple-tasks.yml @@ -1,11 +1,13 @@ - name: run my test run: "echo 'tests'" change: "**" + ignore: ["tests/**", "src/**"] run_on_init: true - name: run my build run: "echo 'build'" - change: "**" + change: ["src/**"] + ignore: ["tests/**", "src/**/*.specs"] - name: run my lint run: "echo 'lint'" diff --git a/examples/piped.yml b/examples/piped.yml deleted file mode 100644 index 2bd2ec3..0000000 --- a/examples/piped.yml +++ /dev/null @@ -1,4 +0,0 @@ -- name: run my test - run: "echo 'foo' | sed 's/foo/bar/g'" - change: "**" - run_on_init: true diff --git a/tests/integration/specs/list-of-commands-task-test.sh b/tests/integration/specs/list-of-commands-task-test.sh index 57e955d..3bba1b5 100644 --- a/tests/integration/specs/list-of-commands-task-test.sh +++ b/tests/integration/specs/list-of-commands-task-test.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source "$HELPERS" -test "it a list of commands for the same task (on init)" +test "it allows a list of commands for the same task (on init)" echo " - name: run complex command @@ -29,7 +29,7 @@ if [ -n "$CI" ]; then exit 0 fi -test "it a list of commands for the same task (on change)" +test "it allows a list of commands for the same task (on change)" echo " - name: run complex command