chore: refactor pipelines (#97)

## Description

<!-- **Please link some issue here describing what you are trying to achieve.**

In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->

relates to #1234

## Checklist

- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)

Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Reviewed-on: #97
This commit is contained in:
Marcel_Henselin 2026-03-27 15:23:30 +00:00
parent 2893a11c0a
commit 7b2dfaea44
Signed by: tf-provider.git.onstackit.cloud
GPG key ID: 6D7E8A1ED8955A9C
5 changed files with 145 additions and 50 deletions

View file

@ -67,9 +67,13 @@ inputs:
outputs:
result:
value: ${{ steps.testrun.result }}
value: "${{ steps.testrun.result }}"
description: "the output of the tests"
status:
value: "${{ steps.status.status }}"
description: "the status of the tests"
runs:
using: "composite"
steps:
@ -213,6 +217,8 @@ runs:
fi
testfile="${{ inputs.test_file }}"
echo "result=no result before run" >> "$GITHUB_OUTPUT"
echo "Running acceptance tests for the terraform provider"
set +e
@ -230,11 +236,14 @@ runs:
echo "::endgroup::"
set -e
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"
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"
exit 1
else
echo "result=no FAIL detected" >> "$GITHUB_OUTPUT"
fi
echo "::endgroup::"
env:
@ -246,10 +255,12 @@ runs:
TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }}
TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }}
- name: Artifact upload start
- name: Set status output variable
if: always()
id: status
shell: bash
run: |
echo "::group::artifact upload"
echo "status=${{ steps.testrun.outcome == 'success' && 'SUCCESS' || 'FAILURE' }}" >> "$GITHUB_OUTPUT"
- name: Upload test log artifact
if: always()
@ -257,8 +268,3 @@ runs:
with:
name: acc_test.log
path: "stackit/acc_test_run.log"
- name: Artifact upload finish
shell: bash
run: |
echo "::endgroup::"