add tests for various actions
This commit is contained in:
1
actions/testdata/action1/Dockerfile
vendored
Normal file
1
actions/testdata/action1/Dockerfile
vendored
Normal file
@@ -0,0 +1 @@
|
||||
FROM ubuntu:18.04
|
1
actions/testdata/action2/Dockerfile
vendored
Normal file
1
actions/testdata/action2/Dockerfile
vendored
Normal file
@@ -0,0 +1 @@
|
||||
FROM alpine:3.8
|
21
actions/testdata/basic.workflow
vendored
Normal file
21
actions/testdata/basic.workflow
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
workflow "build-and-deploy" {
|
||||
on = "push"
|
||||
resolves = ["deploy"]
|
||||
}
|
||||
|
||||
action "build" {
|
||||
uses = "./action1"
|
||||
args = "echo 'build'"
|
||||
}
|
||||
|
||||
action "test" {
|
||||
uses = "docker://ubuntu:18.04"
|
||||
args = "echo 'test'"
|
||||
needs = ["build"]
|
||||
}
|
||||
|
||||
action "deploy" {
|
||||
uses = "./action2"
|
||||
runs = ["/bin/sh", "-c", "cat $GITHUB_EVENT_PATH"]
|
||||
needs = ["test"]
|
||||
}
|
13
actions/testdata/fail.workflow
vendored
Normal file
13
actions/testdata/fail.workflow
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
workflow "test" {
|
||||
on = "push"
|
||||
resolves = ["test-action"]
|
||||
}
|
||||
|
||||
action "test-action" {
|
||||
uses = "docker://alpine:3.9"
|
||||
runs = ["sh", "-c", "echo $IN | grep $OUT"]
|
||||
env = {
|
||||
IN = "foo"
|
||||
OUT = "bar"
|
||||
}
|
||||
}
|
13
actions/testdata/pipe.workflow
vendored
Normal file
13
actions/testdata/pipe.workflow
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
workflow "test" {
|
||||
on = "push"
|
||||
resolves = ["test-action"]
|
||||
}
|
||||
|
||||
action "test-action" {
|
||||
uses = "docker://alpine:3.9"
|
||||
runs = ["sh", "-c", "echo $IN | grep $OUT"]
|
||||
env = {
|
||||
IN = "foo"
|
||||
OUT = "foo"
|
||||
}
|
||||
}
|
9
actions/testdata/regex.workflow
vendored
Normal file
9
actions/testdata/regex.workflow
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
workflow "New workflow" {
|
||||
on = "push"
|
||||
resolves = ["filter-version-before-deploy"]
|
||||
}
|
||||
|
||||
action "filter-version-before-deploy" {
|
||||
uses = "actions/bin/filter@master"
|
||||
args = "tag z?[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||
}
|
Reference in New Issue
Block a user