summaryrefslogtreecommitdiff
path: root/test/asset
diff options
context:
space:
mode:
Diffstat (limited to 'test/asset')
-rw-r--r--test/asset/artifact/minici.yaml25
-rw-r--r--test/asset/publish/from_dependency.yaml84
-rw-r--r--test/asset/publish/from_self.yaml22
-rw-r--r--test/asset/repo/checkout.yaml105
-rw-r--r--test/asset/run/dependencies.yaml62
-rw-r--r--test/asset/run/explicit.yaml7
-rw-r--r--test/asset/run/external.yaml42
-rw-r--r--test/asset/run/many_repos.yaml109
-rw-r--r--test/asset/run/norepo-basic.yaml20
-rw-r--r--test/asset/run/repo-basic.yaml7
-rw-r--r--test/asset/run/repo-basic2.yaml15
-rw-r--r--test/asset/run/rerun.yaml45
12 files changed, 543 insertions, 0 deletions
diff --git a/test/asset/artifact/minici.yaml b/test/asset/artifact/minici.yaml
new file mode 100644
index 0000000..7204bb3
--- /dev/null
+++ b/test/asset/artifact/minici.yaml
@@ -0,0 +1,25 @@
+job generate:
+ checkout: null
+
+ shell:
+ - echo "content 1" > f1
+ - mkdir -p dir/subdir
+ - echo "content 2" > dir/f2
+ - echo "content a" > dir/fa
+ - echo "content b" > dir/subdir/fb
+ - echo "content 3" > f3
+
+ artifact first:
+ path: f1
+
+ artifact second:
+ path: dir/f2
+
+ artifact third:
+ path: f3
+
+ artifact dir:
+ path: dir
+
+ artifact sdir:
+ path: dir/subdir
diff --git a/test/asset/publish/from_dependency.yaml b/test/asset/publish/from_dependency.yaml
new file mode 100644
index 0000000..6bbfbf8
--- /dev/null
+++ b/test/asset/publish/from_dependency.yaml
@@ -0,0 +1,84 @@
+destination first:
+ url: ./first/dest
+
+destination second:
+ url: ./second/dest
+
+destination third:
+
+destination fourth:
+
+destination fifth:
+
+
+job gen:
+ checkout:
+
+ shell:
+ - mkdir dir
+ - mkdir dir2
+ - mkdir dir2/subdir
+ - touch x
+ - touch dir/y
+ - touch dir2/z2
+ - touch dir2/subdir/z
+
+ artifact x:
+ path: ./x
+
+ artifact y:
+ path: ./dir/y
+
+ artifact z:
+ path: ./dir2/subdir/z
+
+ artifact dir:
+ path: ./dir
+
+ artifact dir2:
+ path: ./dir2
+
+ artifact dir2_subdir:
+ path: ./dir2/subdir
+
+
+job publish:
+ publish:
+ - to: first
+ artifact: gen.x
+
+ - to: first
+ artifact: gen.y
+
+ - to: second
+ artifact: gen.z
+
+ - to: third
+ artifact: gen.dir
+
+ - to: third
+ artifact: gen.dir2_subdir
+
+ - to: fourth
+ artifact: gen.x
+ path: path/for/artifact
+
+ - to: fourth
+ artifact: gen.x
+ path: dir/for/artifact/
+
+ - to: fifth
+ artifact: gen.dir2_subdir
+ path: path/for/artifact
+
+ - to: fifth
+ artifact: gen.dir2_subdir
+ path: dir/for/artifact/
+
+ - to: fifth
+ artifact: gen.dir2
+ path: path2/for/artifact
+
+ - to: fifth
+ artifact: gen.dir2
+ path: dir2/for/artifact/
diff --git a/test/asset/publish/from_self.yaml b/test/asset/publish/from_self.yaml
new file mode 100644
index 0000000..92d10e9
--- /dev/null
+++ b/test/asset/publish/from_self.yaml
@@ -0,0 +1,22 @@
+destination dest:
+
+
+job gen_publish:
+ checkout:
+
+ shell:
+ - touch x
+ - touch y
+
+ artifact x:
+ path: x
+
+ artifact y:
+ path: y
+
+ publish:
+ - to: dest
+ artifact: x
+
+ - to: dest
+ artifact: gen_publish.y
diff --git a/test/asset/repo/checkout.yaml b/test/asset/repo/checkout.yaml
new file mode 100644
index 0000000..05e0e99
--- /dev/null
+++ b/test/asset/repo/checkout.yaml
@@ -0,0 +1,105 @@
+repo r1:
+repo r2:
+repo r3:
+
+job checkout_subtree:
+ checkout:
+ - repo: r1
+ dest: d1
+
+ - repo: r2
+ subtree: s1
+ dest: d2_s1
+
+ shell:
+ - find \! -name 'list?' -type f > list1
+
+ artifact out:
+ path: list1
+
+
+job checkout_common_root:
+ checkout:
+ - repo: r1
+ dest: d1
+
+ - repo: r2
+ subtree: s1
+ dest: d2_s1
+
+ - repo: r2
+ subtree: s2
+ dest: d2_s2
+
+ shell:
+ - find \! -name 'list?' -type f > list2
+
+ artifact out:
+ path: list2
+
+
+job checkout_common_subtree:
+ checkout:
+ - repo: r3
+ subtree: a/b/s1
+ dest: d3_s1
+
+ - repo: r3
+ subtree: a/b/c/s2
+ dest: d3_s2
+
+ shell:
+ - find \! -name 'list?' -type f > list3
+
+ artifact out:
+ path: list3
+
+
+job checkout_common_subtree2:
+ checkout:
+ - repo: r1
+ dest: d1
+
+ - repo: r2
+ subtree: s1
+ dest: d2_s1
+
+ - repo: r3
+ subtree: a/b/c/s2
+ dest: d3_s2
+
+ - repo: r3
+ subtree: a/b/c/s3
+ dest: d3_s3
+
+ shell:
+ - find \! -name 'list?' -type f > list4
+
+ artifact out:
+ path: list4
+
+
+job combined_subtree:
+ uses:
+ - checkout_common_root.out
+ - checkout_common_subtree2.out
+
+ shell:
+ - find \! -name 'list5' -type f > list5
+
+ artifact out:
+ path: list5
+
+
+job combined_all:
+ uses:
+ - checkout_subtree.out
+ - checkout_common_root.out
+ - checkout_common_subtree.out
+ - checkout_common_subtree2.out
+
+ shell:
+ - find \! -name 'list6' -type f > list6
+
+ artifact out:
+ path: list6
diff --git a/test/asset/run/dependencies.yaml b/test/asset/run/dependencies.yaml
new file mode 100644
index 0000000..13d5e63
--- /dev/null
+++ b/test/asset/run/dependencies.yaml
@@ -0,0 +1,62 @@
+repo other:
+
+job first:
+ shell:
+ - touch x
+
+ artifact out:
+ path: x
+
+
+job second:
+ uses:
+ - first.out
+
+ shell:
+ - mv x y
+
+ artifact out:
+ path: y
+
+
+job third:
+ uses:
+ - first.out
+
+ shell:
+ - mv x z
+
+ artifact out:
+ path: z
+
+
+job fourth:
+ checkout:
+ - dest: a
+ - repo: other
+ dest: b
+
+ uses:
+ - second.out
+
+ shell:
+ - mv y w
+
+ artifact out:
+ path: w
+
+
+job fifth:
+ uses:
+ - third.out
+ - fourth.out
+
+ shell:
+ - mv z z2
+ - mv w w2
+
+ artifact out1:
+ path: z2
+
+ artifact out2:
+ path: w2
diff --git a/test/asset/run/explicit.yaml b/test/asset/run/explicit.yaml
new file mode 100644
index 0000000..d543d16
--- /dev/null
+++ b/test/asset/run/explicit.yaml
@@ -0,0 +1,7 @@
+job build:
+ shell:
+ - ls subdir | sed -e ':a;N;s/\n/ /;ta' > list
+ - echo >> list
+
+ artifact out:
+ path: list
diff --git a/test/asset/run/external.yaml b/test/asset/run/external.yaml
new file mode 100644
index 0000000..f1d2b2c
--- /dev/null
+++ b/test/asset/run/external.yaml
@@ -0,0 +1,42 @@
+repo first:
+ path: ../first
+
+repo second:
+ path: ../second
+
+
+job single:
+ checkout:
+ repo: first
+ dest: first
+
+ shell:
+ - tar czf first.tar.gz first
+
+ artifact tarball:
+ path: ./first.tar.gz
+
+job multiple:
+ checkout:
+ - repo: first
+ dest: first-subdir
+ subtree: subdir
+ - repo: second
+ dest: second-subdir
+ subtree: sub
+
+ shell:
+ - tar czf pack.tar.gz first-subdir second-subdir
+
+ artifact tarball:
+ path: ./pack.tar.gz
+
+job combine:
+ checkout: null
+
+ shell:
+ - ls
+
+ uses:
+ - single.tarball
+ - multiple.tarball
diff --git a/test/asset/run/many_repos.yaml b/test/asset/run/many_repos.yaml
new file mode 100644
index 0000000..d861433
--- /dev/null
+++ b/test/asset/run/many_repos.yaml
@@ -0,0 +1,109 @@
+repo r1:
+repo r2:
+repo r3:
+repo r4:
+repo r5:
+
+destination d1:
+
+job first:
+ checkout:
+ - repo: r1
+ dest: d1
+ - repo: r4
+ dest: d4b
+ - repo: r3
+ dest: d3
+ - repo: r2
+ dest: d2
+ - repo: r4
+ dest: d4
+
+ shell:
+ - touch some_file
+
+ artifact out:
+ path: some_file
+
+job first_manual_revision:
+ checkout:
+ - repo: r1
+ dest: d1
+ - repo: r1
+ dest: d1b
+ revision: tag1
+ - repo: r2
+ dest: d2b
+ revision: tag1
+ - repo: r4
+ dest: d4b
+ - repo: r3
+ dest: d3
+ revision: tag1
+ - repo: r2
+ dest: d2
+ - repo: r4
+ dest: d4
+
+ shell:
+ - touch some_file
+
+ artifact out:
+ path: some_file
+
+
+job second:
+ checkout:
+ - dest: main
+ - repo: r2
+ dest: d2
+ - repo: r5
+ dest: d5
+ - repo: r3
+ dest: d3
+
+ shell:
+ - touch second_file
+
+ artifact out:
+ path: second_file
+
+
+job dependent:
+ uses:
+ - first.out
+
+ shell:
+ - mv some_file some_other_file
+
+ artifact out:
+ path: some_other_file
+
+
+job dependent_publish:
+ publish:
+ - to: d1
+ artifact: first.out
+
+
+job transitive:
+ uses:
+ - dependent.out
+
+ artifact out:
+ path: some_other_file
+
+
+job combined:
+ uses:
+ - first.out
+ - second.out
+
+ artifact out:
+ path: second_file
+
+
+job combined_transitive:
+ uses:
+ - combined.out
+ - transitive.out
diff --git a/test/asset/run/norepo-basic.yaml b/test/asset/run/norepo-basic.yaml
new file mode 100644
index 0000000..ecd3a97
--- /dev/null
+++ b/test/asset/run/norepo-basic.yaml
@@ -0,0 +1,20 @@
+job success:
+ checkout: null
+ shell:
+ - "true"
+
+job failure:
+ checkout: null
+ shell:
+ - "false"
+
+job block_recipe:
+ checkout: null
+ shell: |
+ mkdir dir
+ cd dir
+ export VAR='abc'
+ echo $VAR > var
+
+ artifact out:
+ path: dir/var
diff --git a/test/asset/run/repo-basic.yaml b/test/asset/run/repo-basic.yaml
new file mode 100644
index 0000000..82f5650
--- /dev/null
+++ b/test/asset/run/repo-basic.yaml
@@ -0,0 +1,7 @@
+job success:
+ shell:
+ - "true"
+
+job failure:
+ shell:
+ - "false"
diff --git a/test/asset/run/repo-basic2.yaml b/test/asset/run/repo-basic2.yaml
new file mode 100644
index 0000000..bcfac50
--- /dev/null
+++ b/test/asset/run/repo-basic2.yaml
@@ -0,0 +1,15 @@
+job success:
+ shell:
+ - "true"
+
+job third:
+ shell:
+ - "true"
+
+job failure:
+ shell:
+ - "false"
+
+job fourth:
+ shell:
+ - "true"
diff --git a/test/asset/run/rerun.yaml b/test/asset/run/rerun.yaml
new file mode 100644
index 0000000..dc18b41
--- /dev/null
+++ b/test/asset/run/rerun.yaml
@@ -0,0 +1,45 @@
+job first:
+ shell:
+ - touch x
+
+ artifact out:
+ path: x
+
+
+job second:
+ uses:
+ - first.out
+
+ shell:
+ - mv x y
+
+ artifact out:
+ path: y
+
+
+job first_fail:
+ shell:
+ - "false"
+
+ artifact out:
+ path: x
+
+
+job second_skip:
+ uses:
+ - first_fail.out
+
+ shell:
+ - "true"
+
+ artifact out:
+ path: y
+
+
+job third:
+ uses:
+ - second.out
+ - second_skip.out
+
+ shell:
+ - "true"