summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-04 17:40:43 +0200
committerChristian Breunig <christian@breunig.cc>2024-07-05 08:26:09 +0200
commitb5ac16190ac8fa853808b0c2e16ec9899414458b (patch)
treeb9992bc29d86af3a586e945e4ed4ed74b4e68e33 /.github
parentecaa44498949a377622e98c8490e6b83d57ebdc4 (diff)
downloadvyos-1x-b5ac16190ac8fa853808b0c2e16ec9899414458b.tar.gz
vyos-1x-b5ac16190ac8fa853808b0c2e16ec9899414458b.zip
GitHub: T6494: do not use 0/null value to mark build succeed
GitHub performs loose equality comparisons. If the types do not match, GitHub coerces the type to a number. GitHub casts data types to a number using these conversions: https://docs.github.com/en/actions/learn-github-actions/expressions
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/package-smoketest.yml41
1 files changed, 22 insertions, 19 deletions
diff --git a/.github/workflows/package-smoketest.yml b/.github/workflows/package-smoketest.yml
index 08c8d42f5..56fee5784 100644
--- a/.github/workflows/package-smoketest.yml
+++ b/.github/workflows/package-smoketest.yml
@@ -79,12 +79,13 @@ jobs:
id: test
shell: bash
run: |
- # always fail first
- echo "exit_code=1" >> $GITHUB_OUTPUT
+ set -e
sudo make test
- exit_code=$?
- echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
- exit $exit_code
+ if [[ $? == 0 ]]; then
+ echo "exit_code=success" >> $GITHUB_OUTPUT
+ else
+ echo "exit_code=fail" >> $GITHUB_OUTPUT
+ fi
test_config_load:
needs: build_iso
@@ -109,12 +110,13 @@ jobs:
id: test
shell: bash
run: |
- # always fail first
- echo "exit_code=1" >> $GITHUB_OUTPUT
+ set -e
sudo make testc
- exit_code=$?
- echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
- exit $exit_code
+ if [[ $? == 0 ]]; then
+ echo "exit_code=success" >> $GITHUB_OUTPUT
+ else
+ echo "exit_code=fail" >> $GITHUB_OUTPUT
+ fi
test_raid1_install:
needs: build_iso
@@ -139,12 +141,13 @@ jobs:
id: test
shell: bash
run: |
- # always fail first
- echo "exit_code=1" >> $GITHUB_OUTPUT
+ set -e
sudo make testraid
- exit_code=$?
- echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
- exit $exit_code
+ if [[ $? == 0 ]]; then
+ echo "exit_code=success" >> $GITHUB_OUTPUT
+ else
+ echo "exit_code=fail" >> $GITHUB_OUTPUT
+ fi
result:
needs:
@@ -160,15 +163,15 @@ jobs:
uses: mshick/add-pr-comment@v2
with:
message: |
- CI integration ${{ needs.test_smoketest_cli.outputs.exit_code == 0 && needs.test_config_load.outputs.exit_code == 0 && needs.test_raid1_install.outputs.exit_code == 0 && '👍 passed!' || '❌ failed!' }}
+ CI integration ${{ needs.test_smoketest_cli.outputs.exit_code == 'success' && needs.test_config_load.outputs.exit_code == 'success' && needs.test_raid1_install.outputs.exit_code == 'success' && '👍 passed!' || '❌ failed!' }}
### Details
[CI logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
- * ${{ needs.test_smoketest_cli.outputs.exit_code == '0' && '👍 passed' || '❌ failed' }} CLI Smoketests returned: ${{ needs.test_smoketest_cli.outputs.exit_code }}
- * ${{ needs.test_config_load.outputs.exit_code == '0' && '👍 passed' || '❌ failed' }} Config tests returned: ${{ needs.test_config_load.outputs.exit_code }}
- * ${{ needs.test_raid1_install.outputs.exit_code == '0' && '👍 passed' || '❌ failed' }} RAID1 tests returned: ${{ needs.test_raid1_install.outputs.exit_code }}
+ * CLI Smoketests ${{ needs.test_smoketest_cli.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }}
+ * Config tests ${{ needs.test_config_load.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }}
+ * RAID1 tests ${{ needs.test_raid1_install.outputs.exit_code == 'success' && '👍 passed' || '❌ failed' }}
message-id: "SMOKETEST_RESULTS"
allow-repeats: false