Skip to content

Commit

Permalink
Test showing output return value (#2)
Browse files Browse the repository at this point in the history
* change output name
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Co-authored-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Mar 4, 2022
1 parent 430d566 commit d02340c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/libabigail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ jobs:

- name: Run Libabigail with ABI Break
uses: ./
id: with_error
with:
abidiff: libmath.1.so libmath.2.so
allow_fail: false

- name: Example to show output
env:
retval: ${{ steps.with_error.outputs.retval }}
run: echo "The return code was ${retval}, do something custom here"
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ the test should be allowed to fail. Here is an example.
### Example

Let's say we have the repository [buildsi/build-abi-test-mathclient](https://github.com/buildsi/build-abi-test-mathclient).
We have two releases, 1.0 andn 2.0 (on the main branch) and version 2.0 has an ABi break. For the purposes
We have two releases, 1.0 andn 2.0 (on the main branch) and version 2.0 has an ABI break. For the purposes
of the example, let's pretend version 2.0 isn't released and we are opening a PR against the current main (still with version 1.0)
and we want to ensure that no ABI is broken. We would want to:

Expand Down Expand Up @@ -123,8 +123,14 @@ jobs:
# You can add allow_fail: true if you expect a failure
- name: Compare Release to Pull Request
uses: buildsi/libabigail-action@main
id: release-to-pr
with:
abidiff: libmath.1.so libmath.dev.so

- name: Example to show output
env:
retval: ${{ steps.release-to-pr.outputs.retval }}
run: echo "The return code was ${retval}, do something custom here"
```

There are other checks you can do that we might recommend, such as looking at the return
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
required: true
default: false

outputs:
retval:
description: The return value of the action for you to act on

runs:
using: "docker"
image: "Dockerfile"
Expand Down
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ echo "${COMMAND}"
${COMMAND} || (
retval=$?
printf "Return value: $retval\n"
echo "::set-output name=retval::${retval}"

# Failure, but we are allowing it
if [[ ${retval} -ne 0 ]] && [[ "$INPUT_ALLOW_FAIL" == "false" ]]; then
Expand Down

0 comments on commit d02340c

Please sign in to comment.