mirror of
https://github.com/dagger/dagger-for-github.git
synced 2026-01-01 05:00:21 +11:00
tests: add test for multiline output
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
parent
078ac0e046
commit
f2957ff708
1 changed files with 43 additions and 0 deletions
43
.github/workflows/test.yml
vendored
43
.github/workflows/test.yml
vendored
|
|
@ -17,6 +17,49 @@ permissions:
|
|||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
output:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: "Use output"
|
||||
id: use-output
|
||||
uses: ./
|
||||
with:
|
||||
version: latest
|
||||
verb: core
|
||||
args: container from --address=alpine with-exec --args echo,"hello world" stdout
|
||||
- name: "Use output (check)"
|
||||
run: |
|
||||
target='${{ steps.use-output.outputs.output }}'
|
||||
if [[ "$target" == "hello world" ]]; then
|
||||
echo "matches"
|
||||
exit 0
|
||||
else
|
||||
echo "does not match"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: "Use multiline output"
|
||||
id: use-multiline-output
|
||||
uses: ./
|
||||
with:
|
||||
version: latest
|
||||
verb: core
|
||||
args: container from --address=alpine with-exec --args echo,-e,"hello\nworld" stdout
|
||||
- name: "Use output (check)"
|
||||
run: |
|
||||
target='${{ steps.use-multiline-output.outputs.output }}'
|
||||
result='hello
|
||||
world'
|
||||
if [[ "$target" == "$result" ]]; then
|
||||
echo "matches"
|
||||
exit 0
|
||||
else
|
||||
echo "does not match"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue