chore: pipelines #94

Merged
marcel.henselin merged 6 commits from chore/pipelines into main 2026-03-25 12:32:29 +00:00
5 changed files with 180 additions and 12 deletions

View file

@ -65,20 +65,9 @@ inputs:
description: "testfile to run" description: "testfile to run"
default: '' default: ''
#outputs:
# random-number:
# description: "Random number"
# value: ${{ steps.random-number-generator.outputs.random-number }}
runs: runs:
using: "composite" using: "composite"
steps: steps:
# - name: Random Number Generator
# id: random-number-generator
# run: echo "random-number=$(echo $RANDOM)" >> $GITHUB_OUTPUT
# shell: bash
- name: Install needed tools - name: Install needed tools
shell: bash shell: bash
run: | run: |

132
.github/actions/notify/action.yaml vendored Normal file
View file

@ -0,0 +1,132 @@
name: Send notification via Google Chat
description: "Sends a notification to a Google Chat room when a pull request is opened."
inputs:
webhook_url:
description: "The URL of the Google Chat webhook."
required: true
title:
description: "The title of the notification."
required: true
default: 'no title provided'
event_author:
description: "The author of the event."
required: true
default: 'unknown'
event_title:
description: "The title of the event."
required: true
event_body:
description: "The body of the event."
required: true
default: 'no body provided'
event_number:
description: "The number of the event."
required: true
default: 'no number provided'
event_url:
description: "The url of the event."
required: true
default: 'none'
runs:
using: "composite"
steps:
# - name: event list
# shell: bash
# run: |
# cat <<'EOF'
# ${{ toJSON(github) }}
# EOF
#
# - name: print env
# shell: bash
# run: |
# env
# exit 1
- name: Install prerequisites
shell: bash
run: |
echo "::group::apt install"
set -e
apt update
apt install -y curl jq
echo "::endgroup::"
- name: Notify via Google Chat Webhook
shell: bash
env:
WEBHOOK: ${{ inputs.webhook_url }}
run: |
set -e
PAYLOAD=$(jq -n -r \
--arg header "${{ inputs.title }}" \
--arg repo "${{ github.repository || '' }}" \
--arg title "${{ inputs.event_title || 'no event title given' }}" \
--arg body "${{ inputs.event_body || 'no event body given' }}" \
--arg author "${{ inputs.event_author || 'no event author given' }}" \
--arg url "${{ inputs.event_url || github.repositoryUrl || github.server_url }}" \
'{ "cardsV2": [ { "cardId": "notify-${{ github.run_id }}", "card": {
"header": {
"title": "\($header)",
"subtitle": "Repo: \($repo)",
"imageUrl": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/git.png",
"imageType": "SQUARE"
},
"sections": [
{
"header": "\($title)",
"collapsible": false,
"widgets": [
{
"decoratedText": {
"icon": {
"knownIcon": "PERSON"
},
"text": "<b>Opened by:</b> \($author)"
}
},
{
"textParagraph": {
"text": "\($body)",
"maxLines": 2
}
}
]
},
{
"widgets": [
{
"buttonList": {
"buttons": [
{
"text": "View Source Event",
"type": "FILLED",
"onClick": {
"openLink": {
"url": "\($url)"
}
}
}
]
}
}
]
}
]
}} ] }')
curl \
--fail-with-body \
-X POST \
-H 'Content-Type: application/json' \
"${{ inputs.webhook_url }}" \
-d "${PAYLOAD}"

25
.github/workflows/notify_pr.yaml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Notify on new PR
on:
pull_request:
types:
- opened
jobs:
notify:
name: Notify via Google Chat
runs-on: stackit-docker
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Notify
uses: ./.github/actions/notify
with:
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
title: "New Pull Request"
event_title: "${{ github.event.pull_request.title }}"
event_author: "${{ github.event.pull_request.user.login }}"
event_body: "${{ github.event.pull_request.body || 'No description provided.' }}"
event_number: "${{ github.event.pull_request.number }}"
event_url: "${{ github.event.pull_request.html_url }}"

View file

@ -30,6 +30,17 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Notify
uses: ./.github/actions/notify
with:
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
title: Terraform Acceptance Tests started
event_title: ${{ github.event.type }}
event_author: ${{ github.event.actor.login }}
event_body: 'No event body.'
event_number: ${{ github.event.id }}
event_url: "${{ github.repositoryUrl }}"
- name: Run Test (workflow dispatch) - name: Run Test (workflow dispatch)
if: ${{ github.event_name == 'workflow_dispatch' }} if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/acc_test uses: ./.github/actions/acc_test
@ -59,3 +70,14 @@ jobs:
tf_acc_kek_key_ring_id: ${{ vars.TF_ACC_KEK_KEY_RING_ID }} tf_acc_kek_key_ring_id: ${{ vars.TF_ACC_KEK_KEY_RING_ID }}
tf_acc_kek_key_version: ${{ vars.TF_ACC_KEK_KEY_VERSION }} tf_acc_kek_key_version: ${{ vars.TF_ACC_KEK_KEY_VERSION }}
tf_acc_kek_service_account: ${{ vars.TF_ACC_KEK_SERVICE_ACCOUNT }} tf_acc_kek_service_account: ${{ vars.TF_ACC_KEK_SERVICE_ACCOUNT }}
- name: Notify
uses: ./.github/actions/notify
with:
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
title: Terraform Acceptance Tests finished
event_title: ${{ github.event.type }}
event_author: ${{ github.event.actor.login }}
event_body: 'No event body.'
event_number: ${{ github.event.id }}
event_url: "${{ github.repositoryUrl }}"

View file

@ -58,7 +58,7 @@ func CreateInstanceWaitHandler(
) *wait.AsyncActionHandler[v3alpha1api.GetInstanceResponse] { ) *wait.AsyncActionHandler[v3alpha1api.GetInstanceResponse] {
instanceCreated := false instanceCreated := false
var instanceGetResponse *v3alpha1api.GetInstanceResponse var instanceGetResponse *v3alpha1api.GetInstanceResponse
maxWait := time.Minute * 45 maxWait := time.Minute * 90
startTime := time.Now() startTime := time.Now()
extendedTimeout := 0 extendedTimeout := 0
maxFailedCount := 3 maxFailedCount := 3