Skip to content

Commit d8aeb96

Browse files
author
jparisu
committed
test outputs in extra steps
Signed-off-by: jparisu <javierparis@eprosima.com>
1 parent f205d6e commit d8aeb96

3 files changed

Lines changed: 96 additions & 9 deletions

File tree

.github/workflows/pr_test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,31 @@ jobs:
2727
with:
2828
workspace: ${{ github.workspace }}
2929

30+
- name: Test outputs
31+
id: test1
32+
shell: bash
33+
run: |
34+
35+
echo "$GITHUB_OUTPUT"
36+
cat $GITHUB_OUTPUT
37+
echo "test1-output=false" >> $GITHUB_OUTPUT
38+
cat $GITHUB_OUTPUT
39+
40+
- name: Test outputs reception
41+
shell: bash
42+
run: |
43+
44+
echo "$GITHUB_OUTPUT"
45+
cat $GITHUB_OUTPUT
46+
echo "${{ steps.test1.outputs.test1-output }}"
47+
3048
- name: Get diff file of version file
3149
id: diff
3250
uses: eProsima/eProsima-CI/ubuntu/git_diff@feature/versions-update
3351
with:
3452
file-path: ${{ github.workspace }}/${{ inputs.version-file-path }}
3553

54+
3655
- name: Check if file change
3756
shell: bash
3857
run: |

ubuntu/check_version_update/action.yml

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,87 @@ runs:
3232
with:
3333
workspace: ${{ github.workspace }}
3434

35+
- name: Test outputs
36+
shell: bash
37+
id: test1
38+
run: |
39+
40+
echo "::group::Test"
41+
42+
echo "$GITHUB_OUTPUT"
43+
cat $GITHUB_OUTPUT
44+
echo "test1-output=false" >> $GITHUB_OUTPUT
45+
cat $GITHUB_OUTPUT
46+
47+
echo "::endgroup::"
48+
49+
50+
- name: Test outputs reception
51+
shell: bash
52+
run: |
53+
54+
echo "$GITHUB_OUTPUT"
55+
cat $GITHUB_OUTPUT
56+
echo "${{ steps.test1.outputs.test1-output }}"
57+
3558
- name: Get diff file of version file
36-
id: diff
59+
id: diff2
3760
uses: eProsima/eProsima-CI/ubuntu/git_diff@feature/versions-update
3861
with:
3962
file-path: ${{ github.workspace }}/${{ inputs.version-file-path }}
63+
outputs:
64+
have-changes: ${{ steps.diff2.outputs.have-changes }}
65+
66+
- name: get_git_diff_files
67+
id: diff1
68+
shell: bash
69+
run: |
70+
71+
echo "::group::Get git modifications of file ${{ inputs.file-path }}"
72+
73+
echo "have-changes=false" >> $GITHUB_OUTPUT
74+
75+
echo "diff-file-result=" >> $GITHUB_OUTPUT
76+
77+
echo "::endgroup::"
4078
4179
- name: Check if file change
4280
shell: bash
4381
run: |
4482
45-
cat $GITHUB_OUTPUT
83+
if [[ "${{ steps.git_diff.outputs.have-changes }}" != "true" ]]; then
84+
echo "Version file ${{ inputs.version-file-path }} has not been updated"
85+
echo "T.T"
86+
else
87+
echo "Version file ${{ inputs.version-file-path }} updated."
88+
echo "HURRAY! ^.^"
89+
fi
90+
91+
if [[ "${{ steps.diff3.outputs.have-changes }}" != "true" ]]; then
92+
echo "Version file ${{ inputs.version-file-path }} has not been updated"
93+
echo "T.T"
94+
else
95+
echo "Version file ${{ inputs.version-file-path }} updated."
96+
echo "HURRAY! ^.^"
97+
fi
98+
99+
if [[ "${{ steps.diff2.outputs.have-changes }}" != "true" ]]; then
100+
echo "Version file ${{ inputs.version-file-path }} has not been updated"
101+
echo "T.T"
102+
else
103+
echo "Version file ${{ inputs.version-file-path }} updated."
104+
echo "HURRAY! ^.^"
105+
fi
106+
107+
if [[ "${{ steps.diff2.outputs.have-change }}" != "true" ]]; then
108+
echo "Version file ${{ inputs.version-file-path }} has not been updated"
109+
echo "T.T"
110+
else
111+
echo "Version file ${{ inputs.version-file-path }} updated."
112+
echo "HURRAY! ^.^"
113+
fi
46114
47-
if [[ "${{ steps.diff.outputs.have-changes }}" != "true" ]]; then
115+
if [[ "${{ steps.diff1.outputs.have-changes }}" != "true" ]]; then
48116
echo "Version file ${{ inputs.version-file-path }} has not been updated"
49117
echo "T.T"
50118
exit 1

ubuntu/git_diff/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,31 @@ runs:
4040
steps:
4141

4242
- name: get_git_diff_files
43+
id: diff3
4344
shell: bash
4445
run: |
4546
4647
echo "::group::Get git modifications of file ${{ inputs.file-path }}"
4748
4849
git diff "${{ inputs.base-ref }}" "${{ inputs.head-ref }}" ${{ inputs.diff-args }} -- "${{ inputs.file-path }}" > "${{ inputs.result-file }}"
50+
51+
echo "Diff file result:"
4952
cat "${{ inputs.result-file }}"
5053
5154
if [ -s "${{ inputs.result-file }}" ]; then
5255
53-
echo "::set-output name=have-changes::true"
5456
echo "have-changes=true" >> $GITHUB_OUTPUT
57+
echo "have-change=true" >> $GITHUB_OUTPUT
5558
echo "File has changes"
5659
5760
else
5861
59-
echo "::set-output name=have-changes::false"
6062
echo "have-changes=false" >> $GITHUB_OUTPUT
63+
echo "have-change=false" >> $GITHUB_OUTPUT
6164
echo "File has not changes"
6265
6366
fi
6467
65-
# echo "::set-output name=diff-file-result::$(cat "${{ inputs.result-file }}")"
66-
# echo "diff-file-result=$(cat "${{ inputs.result-file }}")" >> $GITHUB_OUTPUT
67-
68-
cat $GITHUB_OUTPUT
68+
echo "diff-file-result=$(cat "${{ inputs.result-file }}")" >> $GITHUB_OUTPUT
6969
7070
echo "::endgroup::"

0 commit comments

Comments
 (0)