Compare commits

...

29 commits

Author SHA1 Message Date
233efb259d
Merge pull request 'chore: merge main into alpha' (#89) from main into alpha
Reviewed-on: #89
2026-03-25 09:25:58 +00:00
03776cc7fd
Merge branch 'alpha' into main
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Failing after 1m22s
CI Workflow / Prepare GO cache (pull_request) Successful in 6m20s
CI Workflow / Test readiness for publishing provider (pull_request) Has been skipped
CI Workflow / CI run tests (pull_request) Has been skipped
CI Workflow / CI run build and linting (pull_request) Has been skipped
CI Workflow / Code coverage report (pull_request) Has been skipped
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Failing after 23m2s
2026-03-25 09:23:47 +00:00
9060aa9f6a
Merge pull request 'chore: add terraform install step to action' (#93) from chore/action_step into main
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Failing after 59s
CI Workflow / Prepare GO cache (pull_request) Successful in 5m23s
CI Workflow / Test readiness for publishing provider (pull_request) Has been skipped
CI Workflow / CI run tests (pull_request) Has been skipped
CI Workflow / CI run build and linting (pull_request) Has been skipped
CI Workflow / Code coverage report (pull_request) Has been skipped
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Failing after 1h41m56s
Reviewed-on: #93
2026-03-25 09:23:14 +00:00
Marcel S. Henselin
5a1dc9cd94 chore: add terraform install step to action
[skip ci]
2026-03-25 10:22:48 +01:00
d34927537a
Merge pull request 'fix: adjust timeouts to 90 mins' (#92) from fix/adjust_timeouts_90_min into main
Some checks failed
Publish / Check GoReleaser config (push) Successful in 10s
CI Workflow / Check GoReleaser config (pull_request) Failing after 47s
CI Workflow / Prepare GO cache (pull_request) Successful in 5m39s
CI Workflow / Test readiness for publishing provider (pull_request) Has been skipped
CI Workflow / CI run tests (pull_request) Has been skipped
CI Workflow / CI run build and linting (pull_request) Has been skipped
CI Workflow / Code coverage report (pull_request) Has been skipped
Publish / Publish provider (push) Successful in 14m52s
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Failing after 1h38m32s
Reviewed-on: #92
2026-03-25 08:45:31 +00:00
Marcel S. Henselin
83b0860115 fix: adjust timeouts to 90 mins
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Failing after 1m2s
CI Workflow / Prepare GO cache (pull_request) Successful in 5m33s
CI Workflow / Test readiness for publishing provider (pull_request) Has been skipped
CI Workflow / CI run tests (pull_request) Has been skipped
CI Workflow / CI run build and linting (pull_request) Has been skipped
CI Workflow / Code coverage report (pull_request) Has been skipped
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Failing after 1h39m47s
2026-03-25 09:40:44 +01:00
Marcel S. Henselin
97645d7a66 fix: update pipelines
[skip ci]
2026-03-18 11:24:57 +01:00
Marcel S. Henselin
94f3dad963 fix: update pipelines
[skip ci]
2026-03-18 11:17:42 +01:00
Marcel S. Henselin
c081f5f7bd fix: update pipelines
[skip ci]
2026-03-18 11:14:33 +01:00
Marcel S. Henselin
8ab8656b5c fix: update pipelines
[skip ci]
2026-03-18 09:59:38 +01:00
Marcel S. Henselin
63435e5e63 fix: update pipelines
[skip ci]
2026-03-18 09:56:24 +01:00
Marcel S. Henselin
e974ccf906 fix: update pipelines
Some checks failed
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Has been cancelled
Publish / Check GoReleaser config (push) Successful in 5s
CI Workflow / Check GoReleaser config (pull_request) Failing after 1m21s
Publish / Publish provider (push) Successful in 5m46s
CI Workflow / Prepare GO cache (pull_request) Successful in 7m36s
CI Workflow / Test readiness for publishing provider (pull_request) Has been skipped
CI Workflow / CI run tests (pull_request) Has been skipped
CI Workflow / CI run build and linting (pull_request) Has been skipped
CI Workflow / Code coverage report (pull_request) Has been skipped
2026-03-18 09:40:23 +01:00
Marcel S. Henselin
1fd2df5c76 fix: update pipelines
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Failing after 1m43s
Publish / Check GoReleaser config (push) Failing after 1m19s
Publish / Publish provider (push) Has been skipped
CI Workflow / Prepare GO cache (pull_request) Successful in 6m55s
CI Workflow / Test readiness for publishing provider (pull_request) Has been skipped
CI Workflow / CI run tests (pull_request) Has been skipped
CI Workflow / CI run build and linting (pull_request) Has been skipped
CI Workflow / Code coverage report (pull_request) Has been skipped
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Failing after 28m45s
fix: implement sql server 200 error
2026-03-18 09:35:14 +01:00
Marcel S. Henselin
aaabadde1a chore: update publish pipeline
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 7s
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Has been cancelled
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / Prepare GO cache (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
CI Workflow / Code coverage report (pull_request) Has been cancelled
Publish / Check GoReleaser config (push) Successful in 8s
Publish / Publish provider (push) Successful in 14m13s
2026-03-17 17:42:25 +01:00
Marcel S. Henselin
0a5bc30d9c chore: update publish pipeline
[skip ci]
2026-03-17 17:39:22 +01:00
Marcel S. Henselin
8ff6b2a4d8 chore: update publish pipeline
[skip ci]
2026-03-17 17:37:36 +01:00
3dbb04c917
chore: update publish pipeline (#91)
[skip ci]

## 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: #91
2026-03-17 16:29:06 +00:00
a1d1750a79
chore: update publish pipeline (#90)
[skip ci]

## 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: #90
2026-03-17 16:21:23 +00:00
76af35f27d
chore: update publish pipeline (#88)
[skip ci]

## 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: #88
2026-03-17 15:59:25 +00:00
01deb9022d
chore: update README (#87)
## 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.net>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Reviewed-on: #87
2026-03-17 15:33:21 +00:00
Marcel S. Henselin
91fe23f5e8 chore: update README
[skip ci]
2026-03-17 16:32:22 +01:00
Marcel S. Henselin
4913ff1c3a Merge branch 'alpha'
# Conflicts:
#	tools/go.sum
2026-03-17 16:25:23 +01:00
dd77da71dd
feat: more_tests (#85)
Some checks failed
Publish / Check GoReleaser config (push) Successful in 7s
Publish / Publish provider (push) Successful in 7m41s
CI Workflow / Check GoReleaser config (pull_request) Successful in 6s
CI Workflow / Prepare GO cache (pull_request) Successful in 10m18s
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / Code coverage report (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Failing after 26m13s
## 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: #85
2026-03-17 15:02:08 +00:00
Marcel S. Henselin
431f6eff8c chore: add sample to main 2026-03-13 11:23:22 +01:00
Marcel S. Henselin
a310d1454a Merge remote-tracking branch 'origin/alpha'
# Conflicts:
#	.github/workflows/publish.yaml
#	generator/cmd/build/build.go
#	generator/cmd/rootCmd.go
#	generator/main.go
#	stackit/internal/services/sqlserverflexalpha/sqlserverflex_acc_test.go
2026-03-13 11:22:10 +01:00
Marcel S. Henselin
7d4cbb6b08 feat: initial copy of v0.1.0
All checks were successful
Publish / Check GoReleaser config (push) Successful in 5s
Publish / Publish provider (push) Successful in 16m14s
2026-03-13 09:03:49 +01:00
Marcel S. Henselin
4cc801a7f3
fix: updated publish pipeline (#3)
Some checks failed
CI Workflow / Check GoReleaser config (push) Has been skipped
CI Workflow / CI (push) Failing after 2m1s
CI Workflow / Code coverage report (push) Has been skipped
Publish / Check GoReleaser config (push) Successful in 4s
Release / goreleaser (push) Failing after 28s
Publish / Publish provider (push) Failing after 2m5s
## 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)

Reviewed-on: #3
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
2026-01-29 10:35:33 +00:00
Marcel S. Henselin
4eff763519
feat: updated pipelines (#1)
Some checks failed
CI Workflow / Check GoReleaser config (push) Has been skipped
CI Workflow / CI (push) Failing after 2m50s
CI Workflow / Code coverage report (push) Has been skipped
## 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)

Reviewed-on: #1
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
2026-01-29 10:27:43 +00:00
Marcel S. Henselin
2733834fc9
Alpha (#4)
Some checks failed
CI Workflow / CI (push) Has been cancelled
CI Workflow / Check GoReleaser config (push) Has been cancelled
CI Workflow / Code coverage report (push) Has been cancelled
* chore: initial push to be able to work together

* chore: add missing wait folder

* chore: add missing folders

* chore: cleanup alpha branch

* feat: mssql alpha instance (#2)

* fix: remove unused attribute types and functions from backup models

* fix: update API client references to use sqlserverflexalpha package

* fix: update package references to use sqlserverflexalpha and modify user data source model

* fix: add sqlserverflexalpha user data source to provider

* fix: add sqlserverflexalpha user resource and update related functionality

* chore: add stackit_sqlserverflexalpha_user resource and instance_id variable

* fix: refactor sqlserverflexalpha user resource and enhance schema with status and default_database

---------

Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>

* feat: add sqlserver instance

* chore: fixing tests

* chore: update docs

---------

Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
2025-12-19 11:37:53 +01:00
65 changed files with 3444 additions and 1881 deletions

View file

@ -2,9 +2,14 @@ name: Acceptance Testing
description: "Acceptance Testing pipeline"
inputs:
tf_debug:
description: "enable terraform debug logs"
default: 'false'
required: true
test_timeout_string:
description: "string that determines the timeout (default: 45m)"
default: '45m'
default: '90m'
required: true
go-version:
@ -89,6 +94,11 @@ runs:
fi
echo "::endgroup::"
# Install latest version of Terraform
- uses: hashicorp/setup-terraform@v4
with:
terraform_wrapper: false
- name: Setup JAVA
uses: actions/setup-java@v5
with:
@ -141,6 +151,12 @@ runs:
${{ steps.goenv.outputs.gomodcache }}
key: ${{ runner.os }}-gopkg
- name: Define service account file path variable
id: service_account
shell: bash
run: |
echo "safilepath=${PWD}/stackit/${{ inputs.service_account_json_file_path }}" >> "$GITHUB_OUTPUT"
- name: Creating service_account file from json input
if: inputs.service_account_json_content != ''
shell: bash
@ -192,6 +208,11 @@ runs:
echo "::group::go test file"
set -e
set -o pipefail
if [[ "${{ inputs.tf_debug }}" == "true" ]]; then
TF_LOG=INFO
export TF_LOG
fi
echo "Running acceptance tests for the terraform provider"
cd stackit || exit 1
@ -204,7 +225,7 @@ runs:
TF_ACC_KEK_KEY_RING_ID=${TF_ACC_KEK_KEY_RING_ID} \
TF_ACC_KEK_KEY_VERSION=${TF_ACC_KEK_KEY_VERSION} \
TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \
go test ${{ inputs.test_file }} -count=1 -timeout=${{ inputs.test_timeout_string }}
go test -v ${{ inputs.test_file }} -timeout=${{ inputs.test_timeout_string }}
echo "::endgroup::"
env:
TF_ACC_PROJECT_ID: ${{ inputs.project_id }}
@ -215,6 +236,7 @@ runs:
TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }}
TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }}
# does not work correctly
# - name: Run test action
# if: ${{ inputs.test_file == '' }}
# env:
@ -226,19 +248,25 @@ runs:
# TF_ACC_KEK_KEY_RING_ID: ${{ inputs.tf_acc_kek_key_ring_id }}
# TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }}
# TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }}
# TF_ACC_SERVICE_ACCOUNT_FILE: "${PWD}/${{ inputs.service_account_json_file_path }}"
# uses: robherley/go-test-action@v0.1.0
# TF_ACC_SERVICE_ACCOUNT_FILE: ${{ steps.service_account.outputs.safile }}
# uses: robherley/go-test-action@v0
# with:
# testArguments: "./... -timeout 45m"
# testArguments: "./... -timeout ${{ inputs.test_timeout_string }}"
# moduleDirectory: "stackit"
- name: Run acceptance tests
if: ${{ inputs.test_file == '' }}
shell: bash
run: |
echo "::group::go test all"
set -e
set -e
set -o pipefail
if [[ "${{ inputs.tf_debug }}" == "true" ]]; then
TF_LOG=INFO
export TF_LOG
fi
echo "Running acceptance tests for the terraform provider"
cd stackit || exit 1
TF_ACC=1 \
@ -250,7 +278,7 @@ runs:
TF_ACC_KEK_KEY_RING_ID=${TF_ACC_KEK_KEY_RING_ID} \
TF_ACC_KEK_KEY_VERSION=${TF_ACC_KEK_KEY_VERSION} \
TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \
go test ./... -count=1 -timeout=${{ inputs.test_timeout_string }}
go test -v ./... -timeout=${{ inputs.test_timeout_string }}
echo "::endgroup::"
env:
TF_ACC_PROJECT_ID: ${{ inputs.project_id }}

1
.github/actions/clean_up/README.md vendored Normal file
View file

@ -0,0 +1 @@
# acceptance test action

168
.github/actions/clean_up/action.yaml vendored Normal file
View file

@ -0,0 +1,168 @@
name: CleanUp Project Resources
description: "Acceptance Testing CleanUp"
inputs:
project_id:
description: "STACKIT project ID for tests"
required: true
region:
description: "STACKIT region for tests"
default: 'eu01'
required: true
tf_resource_prefix:
description: "prefix in resource names"
default: 'tf-acc-'
required: true
service_account_json_content:
description: "STACKIT service account JSON file contents"
required: true
default: ''
service_account_json_content_b64:
description: "STACKIT service account JSON file contents"
required: true
default: ''
list_only:
description: "only list resources, DO NOT delete"
required: true
default: 'true'
log_level:
description: "Log Level"
required: true
default: 'warning'
outputs:
cli-version:
description: "stackit cli version"
value: ${{ steps.stackit_version.outputs.version }}
runs:
using: "composite"
steps:
- name: Install needed tools
shell: bash
run: |
echo "::group::apt install"
set -e
apt-get -y -qq update >apt_update.log 2>apt_update_err.log
if [ $? -ne 0 ]; then
cat apt_update.log apt_update_err.log
fi
apt-get -y -qq install curl gnupg jq >apt_get.log 2>apt_get_err.log
if [ $? -ne 0 ]; then
cat apt_get.log apt_get_err.log
fi
echo "::endgroup::"
echo "::group::apt add source"
curl https://packages.stackit.cloud/keys/key.gpg | gpg --dearmor -o /usr/share/keyrings/stackit.gpg
echo "deb [signed-by=/usr/share/keyrings/stackit.gpg] https://packages.stackit.cloud/apt/cli stackit main" | tee -a /etc/apt/sources.list.d/stackit.list
echo "::endgroup::"
echo "::group::apt install stackit cli"
apt-get -y -qq update >apt_update.log 2>apt_update_err.log
if [ $? -ne 0 ]; then
cat apt_update.log apt_update_err.log
fi
apt-get -y -qq install stackit >apt_get.log 2>apt_get_err.log
if [ $? -ne 0 ]; then
cat apt_get.log apt_get_err.log
fi
echo "::endgroup::"
- name: Check stackit cli version
id: stackit_version
run: |
set -e
VERSION=$(stackit --version | grep "Version:" | cut -d " " -f 2)
echo "stackit cli version: ${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
shell: bash
- name: Creating service_account file from json input
if: inputs.service_account_json_content != ''
shell: bash
run: |
echo "::group::create service account file"
set -e
set -o pipefail
echo "${{ inputs.service_account_json_content }}" > .svc_acc.json
echo "::endgroup::"
- name: Creating service_account file from base64 json input
if: inputs.service_account_json_content_b64 != ''
shell: bash
run: |
echo "::group::create service account file"
set -e
set -o pipefail
echo "${{ inputs.service_account_json_content_b64 }}" | base64 -d > .svc_acc.json
echo "::endgroup::"
- name: Check service account file exists
shell: bash
run: |
set -e
if [[ ! -s .svc_acc.json ]]; then
echo "ERROR: service account file missing or empty"
exit 1
fi
- name: Retrieve resources
run: |
echo "::group::retrieve resources"
set -e
echo "authenticating api"
STACKIT_SERVICE_ACCOUNT_KEY_PATH="${PWD}/.svc_acc.json"
export STACKIT_SERVICE_ACCOUNT_KEY_PATH
stackit auth activate-service-account --service-account-key-path .svc_acc.json
echo "SQL Server Flex resources:"
stackit --verbosity ${{ inputs.log_level }} --project-id "${{ inputs.project_id }}" beta sqlserverflex instance list --output-format json | jq -r '.[] | select(.name | startswith("${{ inputs.tf_resource_prefix }}"))'
echo "PostgreSQL Flex resources:"
stackit --verbosity ${{ inputs.log_level }} --project-id "${{ inputs.project_id }}" postgresflex instance list --output-format json | jq -r '.[] | select(.name | startswith("${{ inputs.tf_resource_prefix }}"))'
echo "::endgroup::"
shell: bash
- name: Delete SQL Server Flex resources
if: ${{ inputs.list_only != 'true' }}
run: |
echo "::group::delete SQL Server Flex resources"
set -e
stackit --verbosity ${{ inputs.log_level }} auth activate-service-account --service-account-key-path .svc_acc.json
for s in $(stackit --verbosity ${{ inputs.log_level }} --project-id ${{ inputs.project_id }} beta sqlserverflex instance list --output-format json | jq -r '.[] | select(.name | startswith("${{ inputs.tf_resource_prefix }}")) | .id'); do stackit --verbosity ${{ inputs.log_level }} -y --project-id ${{ inputs.project_id }} beta sqlserverflex instance delete $s; done
echo "::endgroup::"
shell: bash
- name: Skip Delete SQL Server Flex resources
if: ${{ inputs.list_only == 'true' }}
run: |
set -e
echo "Skip deleting: list only mode"
shell: bash
- name: Delete PostgreSQL Flex resources
if: ${{ inputs.list_only != 'true' }}
run: |
echo "::group::delete PostgreSQL Flex resources"
set -e
stackit auth activate-service-account --service-account-key-path .svc_acc.json
for s in $(stackit --verbosity ${{ inputs.log_level }} --project-id ${{ inputs.project_id }} postgresflex instance list --output-format json | jq -r '.[] | select(.name | startswith("${{ inputs.tf_resource_prefix }}")) | .id'); do stackit --verbosity ${{ inputs.log_level }} -y --project-id ${{ inputs.project_id }} postgresflex instance delete $s; done
echo "::endgroup::"
shell: bash
- name: Skip Delete PostgreSQL Flex resources
if: ${{ inputs.list_only == 'true' }}
run: |
set -e
echo "Skip deleting: list only mode"
shell: bash

View file

@ -2,6 +2,7 @@ name: CI Workflow
on:
pull_request:
types: [ opened, synchronize, reopened ]
branches:
- alpha
- main
@ -27,7 +28,7 @@ jobs:
config:
if: ${{ github.event_name != 'schedule' }}
name: Check GoReleaser config
runs-on: ubuntu-latest
runs-on: stackit-docker
steps:
- name: Checkout
uses: actions/checkout@v6
@ -39,7 +40,7 @@ jobs:
prepare:
name: Prepare GO cache
runs-on: ubuntu-latest
runs-on: stackit-docker
permissions:
actions: read # Required to identify workflow run.
checks: write # Required to add status summary.
@ -101,7 +102,7 @@ jobs:
needs:
- config
- prepare
runs-on: ubuntu-latest
runs-on: stackit-docker
permissions:
actions: read # Required to identify workflow run.
checks: write # Required to add status summary.
@ -184,7 +185,7 @@ jobs:
testing:
name: CI run tests
runs-on: ubuntu-latest
runs-on: stackit-docker
needs:
- config
- prepare
@ -218,11 +219,21 @@ jobs:
run: go mod tidy
- name: Testing
if: ${{ github.event_name != 'pull_request' }}
run: |
unset TF_ACC
TF_ACC_SERVICE_ACCOUNT_FILE=~/.service_account.json
export TF_ACC_SERVICE_ACCOUNT_FILE
make test
- name: Testing with coverage
if: ${{ github.event_name == 'pull_request' }}
run: |
unset TF_ACC
TF_ACC_SERVICE_ACCOUNT_FILE=~/.service_account.json
export TF_ACC_SERVICE_ACCOUNT_FILE
make coverage
# - name: Acceptance Testing
# env:
# TF_ACC: "1"
@ -232,20 +243,20 @@ jobs:
# export TF_ACC_SERVICE_ACCOUNT_FILE
# make test-acceptance-tf
- name: Run Test
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/acc_test
with:
go-version: ${{ env.GO_VERSION }}
project_id: ${{ vars.TF_ACC_PROJECT_ID }}
region: ${{ vars.TF_ACC_REGION }}
service_account_json_content_b64: "${{ secrets.TF_ACC_SERVICE_ACCOUNT_JSON_B64 }}"
project_user_email: ${{ vars.TEST_PROJECT_USER_EMAIL }}
tf_acc_kek_key_id: ${{ vars.TF_ACC_KEK_KEY_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_service_account: ${{ vars.TF_ACC_KEK_SERVICE_ACCOUNT }}
# service_account