chore: modify test action
[skip ci]
This commit is contained in:
parent
5a5752d902
commit
66b3858351
3 changed files with 31 additions and 16 deletions
22
.github/actions/acc_test/action.yaml
vendored
22
.github/actions/acc_test/action.yaml
vendored
|
|
@ -70,6 +70,10 @@ outputs:
|
||||||
value: ${{ steps.testrun.result }}
|
value: ${{ steps.testrun.result }}
|
||||||
description: "the output of the tests"
|
description: "the output of the tests"
|
||||||
|
|
||||||
|
status:
|
||||||
|
value: ${{ steps.testrun.status }}
|
||||||
|
description: "the status of the tests"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -230,11 +234,15 @@ runs:
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
set -e
|
set -e
|
||||||
echo "::group::go test result"
|
echo "::group::go test result"
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
|
if [[ $(cat acc_test_run.log | grep "FAIL") ]]; then
|
||||||
echo "Test failed, see acc_test_run.log for details"
|
echo "Test failed, see acc_test_run.log for details"
|
||||||
res=$(cat acc_test_run.log | grep -v "=== RUN" | grep -v "\-\-\- PASS" | grep -v "=== CONT" | grep -v "=== PAUSE")
|
res=$(cat acc_test_run.log | grep -v "=== RUN" | grep -v "\-\-\- PASS" | grep -v "=== CONT" | grep -v "=== PAUSE")
|
||||||
echo "result=${res}" >> "$GITHUB_OUTPUT"
|
echo "result=FAIL: ${res}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "status=FAILED" >> "$GITHUB_OUTPUT"
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
echo "status=SUCCESS" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
env:
|
env:
|
||||||
|
|
@ -246,19 +254,9 @@ runs:
|
||||||
TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }}
|
TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }}
|
||||||
TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }}
|
TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }}
|
||||||
|
|
||||||
- name: Artifact upload start
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "::group::artifact upload"
|
|
||||||
|
|
||||||
- name: Upload test log artifact
|
- name: Upload test log artifact
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: acc_test.log
|
name: acc_test.log
|
||||||
path: "stackit/acc_test_run.log"
|
path: "stackit/acc_test_run.log"
|
||||||
|
|
||||||
- name: Artifact upload finish
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "::endgroup::"
|
|
||||||
|
|
|
||||||
23
.github/actions/notify/action.yaml
vendored
23
.github/actions/notify/action.yaml
vendored
|
|
@ -11,6 +11,15 @@ inputs:
|
||||||
required: true
|
required: true
|
||||||
default: 'no title provided'
|
default: 'no title provided'
|
||||||
|
|
||||||
|
subtitle:
|
||||||
|
description: "The subtitle of the notification."
|
||||||
|
required: true
|
||||||
|
default: 'no subtitle provided'
|
||||||
|
|
||||||
|
image_url:
|
||||||
|
description: "The URL of the image to be included in the notification."
|
||||||
|
required: false
|
||||||
|
|
||||||
event_author:
|
event_author:
|
||||||
description: "The author of the event."
|
description: "The author of the event."
|
||||||
required: true
|
required: true
|
||||||
|
|
@ -35,6 +44,11 @@ inputs:
|
||||||
required: true
|
required: true
|
||||||
default: 'none'
|
default: 'none'
|
||||||
|
|
||||||
|
status:
|
||||||
|
description: "The status of the event."
|
||||||
|
required: true
|
||||||
|
default: 'unknown'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -69,7 +83,8 @@ runs:
|
||||||
|
|
||||||
PAYLOAD=$(jq -n -r \
|
PAYLOAD=$(jq -n -r \
|
||||||
--arg header "${{ inputs.title }}" \
|
--arg header "${{ inputs.title }}" \
|
||||||
--arg repo "${{ github.repository || '' }}" \
|
--arg subtitle "${{ inputs.subtitle || '' }}" \
|
||||||
|
--arg imgurl "${{ inputs.image_url || 'https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/git.png' }}" \
|
||||||
--arg title "${{ inputs.event_title || 'no event title given' }}" \
|
--arg title "${{ inputs.event_title || 'no event title given' }}" \
|
||||||
--arg body "${{ inputs.event_body || 'no event body given' }}" \
|
--arg body "${{ inputs.event_body || 'no event body given' }}" \
|
||||||
--arg author "${{ inputs.event_author || 'no event author given' }}" \
|
--arg author "${{ inputs.event_author || 'no event author given' }}" \
|
||||||
|
|
@ -77,8 +92,8 @@ runs:
|
||||||
'{ "cardsV2": [ { "cardId": "notify-${{ github.run_id }}", "card": {
|
'{ "cardsV2": [ { "cardId": "notify-${{ github.run_id }}", "card": {
|
||||||
"header": {
|
"header": {
|
||||||
"title": "\($header)",
|
"title": "\($header)",
|
||||||
"subtitle": "Repo: \($repo)",
|
"subtitle": "\($subtitle)",
|
||||||
"imageUrl": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/git.png",
|
"imageUrl": "\($imgurl)",
|
||||||
"imageType": "SQUARE"
|
"imageType": "SQUARE"
|
||||||
},
|
},
|
||||||
"sections": [
|
"sections": [
|
||||||
|
|
@ -91,7 +106,7 @@ runs:
|
||||||
"icon": {
|
"icon": {
|
||||||
"knownIcon": "PERSON"
|
"knownIcon": "PERSON"
|
||||||
},
|
},
|
||||||
"text": "<b>Opened by:</b> \($author)"
|
"text": "<b>\($author)</b>"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
2
.github/workflows/tf-acc-test.yaml
vendored
2
.github/workflows/tf-acc-test.yaml
vendored
|
|
@ -45,6 +45,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
|
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
|
||||||
title: Terraform Acceptance Tests started
|
title: Terraform Acceptance Tests started
|
||||||
|
subtitle: "${{ github.repository }}"
|
||||||
event_title: ${{ github.event_name }}
|
event_title: ${{ github.event_name }}
|
||||||
event_author: ${{ github.actor }}
|
event_author: ${{ github.actor }}
|
||||||
event_body: ${{ inputs.test_file }}
|
event_body: ${{ inputs.test_file }}
|
||||||
|
|
@ -89,6 +90,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
|
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
|
||||||
title: Terraform Acceptance Tests finished
|
title: Terraform Acceptance Tests finished
|
||||||
|
subtitle: ""
|
||||||
event_title: ${{ github.event_name }}
|
event_title: ${{ github.event_name }}
|
||||||
event_author: ${{ github.actor }}
|
event_author: ${{ github.actor }}
|
||||||
event_body: "${{ steps.automatic_run.outputs.result || steps.manual_run.outputs.result }}"
|
event_body: "${{ steps.automatic_run.outputs.result || steps.manual_run.outputs.result }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue