Acceptance Tests #523
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code generated by 'make pre-commit' DO NOT EDIT. | |
name: Acceptance Tests | |
on: | |
schedule: | |
- cron: '30 19 * * *' | |
workflow_dispatch: | |
env: | |
ACC_TEST_CI: 1 | |
jobs: | |
createproject: | |
name: Create Project | |
runs-on: ubuntu-latest | |
outputs: | |
projectID: ${{ steps.create_project.outputs.ACC_TEST_PROJECT_ID }} | |
steps: | |
- name: Create test project | |
id: create_project | |
shell: bash | |
run: | | |
JSON_DATA=$(cat << EOF | |
{ | |
"name": "${{ github.event.repository.name }}_${{ github.run_id }}", | |
"containerParentId": "${{ secrets.ACC_TEST_PARENT_CONTAINER_ID }}", | |
"members": [ | |
{ | |
"role": "project.owner", | |
"subject": "${{ secrets.ACC_TEST_USER_EMAIL }}" | |
},{ | |
"role": "project.owner", | |
"subject": "${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" | |
} | |
], | |
"labels": { | |
"billingReference": "${{ secrets.ACC_TEST_BILLING_REF }}", | |
"scope": "PUBLIC" | |
} | |
} | |
EOF | |
) | |
curl --location --request POST 'https://api.stackit.cloud/resource-management/v2/projects' \ | |
--header 'Content-Type: application/json' \ | |
--header 'Accept: application/json' \ | |
--header 'Authorization: Bearer ${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}' \ | |
--data-raw "${JSON_DATA}" > pr.json | |
ACC_TEST_PROJECT_ID="$(jq -r '.projectId' pr.json)" | |
echo "ACC_TEST_PROJECT_ID=${ACC_TEST_PROJECT_ID}" >> $GITHUB_ENV | |
echo "ACC_TEST_PROJECT_ID=${ACC_TEST_PROJECT_ID}" >> $GITHUB_OUTPUT | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
cat pr.json; | |
exit 1; | |
fi; | |
- name: Wait project created | |
id: wait_project_active | |
uses: mydea/action-wait-for-api@v1 | |
with: | |
url: 'https://api.stackit.cloud/resource-management/v2/projects/${{ env.ACC_TEST_PROJECT_ID }}' | |
headers: '{ | |
"Accept": "application/json", | |
"Authorization": "Bearer ${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" | |
}' | |
expected-response-field: 'lifecycleState' | |
expected-response-field-value: 'ACTIVE' | |
datasource-argus: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [argus instance,argus job] | |
include: | |
- name: argus instance | |
path: stackit/internal/data-sources/argus/instance | |
- name: argus job | |
path: stackit/internal/data-sources/argus/job | |
name: ${{ matrix.name }} data source | |
needs: createproject | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} Data Source | |
run: | | |
echo $path | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
datasource-data-services: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [data-services credential,data-services instance] | |
include: | |
- name: data-services credential | |
path: stackit/internal/data-sources/data-services/credential | |
- name: data-services instance | |
path: stackit/internal/data-sources/data-services/instance | |
name: ${{ matrix.name }} data source | |
needs: createproject | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} Data Source | |
run: | | |
echo $path | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
datasource-kubernetes: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [kubernetes cluster,kubernetes project] | |
include: | |
- name: kubernetes cluster | |
path: stackit/internal/data-sources/kubernetes/cluster | |
- name: kubernetes project | |
path: stackit/internal/data-sources/kubernetes/project | |
name: ${{ matrix.name }} data source | |
needs: createproject | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} Data Source | |
run: | | |
echo $path | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
datasource-mongodb-flex: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [mongodb-flex instance,mongodb-flex user] | |
include: | |
- name: mongodb-flex instance | |
path: stackit/internal/data-sources/mongodb-flex/instance | |
- name: mongodb-flex user | |
path: stackit/internal/data-sources/mongodb-flex/user | |
name: ${{ matrix.name }} data source | |
needs: createproject | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} Data Source | |
run: | | |
echo $path | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
datasource-object-storage: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [object-storage bucket,object-storage credential,object-storage credentials-group,object-storage project] | |
include: | |
- name: object-storage bucket | |
path: stackit/internal/data-sources/object-storage/bucket | |
- name: object-storage credential | |
path: stackit/internal/data-sources/object-storage/credential | |
- name: object-storage credentials-group | |
path: stackit/internal/data-sources/object-storage/credentials-group | |
- name: object-storage project | |
path: stackit/internal/data-sources/object-storage/project | |
name: ${{ matrix.name }} data source | |
needs: createproject | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} Data Source | |
run: | | |
echo $path | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
datasource-postgres-flex: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [postgres-flex instance,postgres-flex user] | |
include: | |
- name: postgres-flex instance | |
path: stackit/internal/data-sources/postgres-flex/instance | |
- name: postgres-flex user | |
path: stackit/internal/data-sources/postgres-flex/user | |
name: ${{ matrix.name }} data source | |
needs: createproject | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} Data Source | |
run: | | |
echo $path | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
datasource-secrets-manager: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [secrets-manager instance,secrets-manager user] | |
include: | |
- name: secrets-manager instance | |
path: stackit/internal/data-sources/secrets-manager/instance | |
- name: secrets-manager user | |
path: stackit/internal/data-sources/secrets-manager/user | |
name: ${{ matrix.name }} data source | |
needs: createproject | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} Data Source | |
run: | | |
echo $path | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
datasources: | |
strategy: | |
fail-fast: false | |
matrix: | |
name: [load-balancer,project] | |
include: | |
- name: load-balancer | |
path: stackit/internal/data-sources/load-balancer | |
- name: project | |
path: stackit/internal/data-sources/project | |
name: ${{ matrix.name }} data source | |
needs: createproject | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} Data Source | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
resource-argus: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [argus credential,argus instance,argus job] | |
include: | |
- name: argus credential | |
path: stackit/internal/resources/argus/credential | |
- name: argus instance | |
path: stackit/internal/resources/argus/instance | |
- name: argus job | |
path: stackit/internal/resources/argus/job | |
name: ${{ matrix.name }} resource | |
needs: [createproject,datasource-argus] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} resource | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
resource-data-services: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [data-services credential,data-services instance] | |
include: | |
- name: data-services credential | |
path: stackit/internal/resources/data-services/credential | |
- name: data-services instance | |
path: stackit/internal/resources/data-services/instance | |
name: ${{ matrix.name }} resource | |
needs: [createproject,datasource-data-services] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} resource | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
resource-kubernetes: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [kubernetes cluster,kubernetes project] | |
include: | |
- name: kubernetes cluster | |
path: stackit/internal/resources/kubernetes/cluster | |
- name: kubernetes project | |
path: stackit/internal/resources/kubernetes/project | |
name: ${{ matrix.name }} resource | |
needs: [createproject,datasource-kubernetes] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} resource | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
resource-mongodb-flex: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [mongodb-flex instance,mongodb-flex user] | |
include: | |
- name: mongodb-flex instance | |
path: stackit/internal/resources/mongodb-flex/instance | |
- name: mongodb-flex user | |
path: stackit/internal/resources/mongodb-flex/user | |
name: ${{ matrix.name }} resource | |
needs: [createproject,datasource-mongodb-flex] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} resource | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
resource-object-storage: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [object-storage bucket,object-storage credential,object-storage credentials-group,object-storage project] | |
include: | |
- name: object-storage bucket | |
path: stackit/internal/resources/object-storage/bucket | |
- name: object-storage credential | |
path: stackit/internal/resources/object-storage/credential | |
- name: object-storage credentials-group | |
path: stackit/internal/resources/object-storage/credentials-group | |
- name: object-storage project | |
path: stackit/internal/resources/object-storage/project | |
name: ${{ matrix.name }} resource | |
needs: [createproject,datasource-object-storage] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} resource | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
resource-postgres-flex: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [postgres-flex instance,postgres-flex user] | |
include: | |
- name: postgres-flex instance | |
path: stackit/internal/resources/postgres-flex/instance | |
- name: postgres-flex user | |
path: stackit/internal/resources/postgres-flex/user | |
name: ${{ matrix.name }} resource | |
needs: [createproject,datasource-postgres-flex] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} resource | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
resource-secrets-manager: | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
name: [secrets-manager instance,secrets-manager user] | |
include: | |
- name: secrets-manager instance | |
path: stackit/internal/resources/secrets-manager/instance | |
- name: secrets-manager user | |
path: stackit/internal/resources/secrets-manager/user | |
name: ${{ matrix.name }} resource | |
needs: [createproject,datasource-secrets-manager] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} resource | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
resources: | |
strategy: | |
fail-fast: false | |
matrix: | |
name: [load-balancer,project] | |
include: | |
- name: load-balancer | |
path: stackit/internal/resources/load-balancer | |
- name: project | |
path: stackit/internal/resources/project | |
name: ${{ matrix.name }} resource | |
needs: [createproject,datasources] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
check-latest: true | |
cache: true | |
- name: Test ${{ matrix.name }} resource | |
run: | | |
export ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}} | |
if [[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]]; then | |
exit 1; | |
fi; | |
make ci-testacc TEST="./${{ matrix.path }}/..." ACC_TEST_BILLING_REF="${{ secrets.ACC_TEST_BILLING_REF }}" ACC_TEST_USER_EMAIL="${{ secrets.ACC_TEST_USER_EMAIL }}" STACKIT_SERVICE_ACCOUNT_TOKEN="${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}" STACKIT_SERVICE_ACCOUNT_EMAIL="${{ secrets.STACKIT_SERVICE_ACCOUNT_EMAIL }}" OS_AUTH_URL="${{ secrets.OS_AUTH_URL }}" OS_PASSWORD="${{ secrets.OS_PASSWORD }}" OS_PROJECT_DOMAIN_ID="${{ secrets.OS_PROJECT_DOMAIN_ID }}" OS_PROJECT_NAME="${{ secrets.OS_PROJECT_NAME }}" OS_REGION_NAME="${{ secrets.OS_REGION_NAME }}" OS_TENANT_ID="${{ secrets.OS_TENANT_ID }}" OS_TENANT_NAME="${{ secrets.OS_TENANT_NAME }}" OS_USERNAME="${{ secrets.OS_USERNAME }}" OS_USER_DOMAIN_NAME="${{ secrets.OS_USER_DOMAIN_NAME }}" | |
- name: Save results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
path: .github/files/analyze-test-output/result/*.json | |
deleteproject: | |
name: Delete Project | |
runs-on: ubuntu-latest | |
needs: [createproject,resources,resource-argus,resource-data-services,resource-kubernetes,resource-mongodb-flex,resource-object-storage,resource-postgres-flex,resource-secrets-manager] | |
if: ${{ always() }} | |
steps: | |
- name: Prepare deletion | |
id: prep_deletion | |
if: always() | |
shell: bash | |
run: | | |
echo "ACC_TEST_PROJECT_ID=${{needs.createproject.outputs.projectID}}" >> $GITHUB_ENV | |
- name: Delete test project | |
id: delete_project | |
if: always() | |
shell: bash | |
run: | | |
[[ -z "${ACC_TEST_PROJECT_ID}" || "${ACC_TEST_PROJECT_ID}" == "NULL" || "${ACC_TEST_PROJECT_ID}" == "null" ]] && exit 0 | |
echo "Deleting project ID: ${ACC_TEST_PROJECT_ID}" | |
curl --location --request DELETE 'https://api.stackit.cloud/resource-management/v2/projects/${{ env.ACC_TEST_PROJECT_ID }}' \ | |
--header 'Accept: application/json' \ | |
--header 'Authorization: Bearer ${{ secrets.STACKIT_SERVICE_ACCOUNT_TOKEN }}' | |
processresult: | |
name: Process Test Results | |
runs-on: ubuntu-latest | |
needs: [createproject,resources,resource-argus,resource-data-services,resource-kubernetes,resource-mongodb-flex,resource-object-storage,resource-postgres-flex,resource-secrets-manager] | |
if: ${{ always() }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }} | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: .github/files/process-test-results | |
- name: Run process | |
run: | | |
export HCTI_USER_ID="${{ secrets.HCTI_USER_ID }}" | |
export HCTI_API_KEY="${{ secrets.HCTI_API_KEY }}" | |
export TEAMS_WEBHOOK_URL="${{ secrets.TEAMS_WEBHOOK_URL }}" | |
make ci-process-results | |
git config --global user.name 'do87' | |
git config --global user.email 'do87@users.noreply.github.com' | |
git add README.md | |
git commit -m "Automated readme update" | |
git pull -r | |
git push |