fix: fix tf acc test pipeline
Some checks failed
CI Workflow / Prepare GO cache (pull_request) Has been cancelled
CI Workflow / Test readiness for publishing provider (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
CI Workflow / Check GoReleaser config (pull_request) Has been cancelled
Some checks failed
CI Workflow / Prepare GO cache (pull_request) Has been cancelled
CI Workflow / Test readiness for publishing provider (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
CI Workflow / Check GoReleaser config (pull_request) Has been cancelled
This commit is contained in:
parent
aa1cfaf5b0
commit
9b5db499b6
2 changed files with 56 additions and 17 deletions
65
.github/actions/acc_test/action.yaml
vendored
65
.github/actions/acc_test/action.yaml
vendored
|
|
@ -11,6 +11,26 @@ inputs:
|
||||||
description: "STACKIT project ID for tests"
|
description: "STACKIT project ID for tests"
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
project_user_email:
|
||||||
|
required: true
|
||||||
|
description: "project user email for acc testing"
|
||||||
|
|
||||||
|
tf_acc_kek_key_id:
|
||||||
|
description: "KEK key ID"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
tf_acc_kek_key_ring_id:
|
||||||
|
description: "KEK key ring ID"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
tf_acc_kek_key_version:
|
||||||
|
description: "KEK key version"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
tf_acc_kek_service_account:
|
||||||
|
description: "KEK service account email"
|
||||||
|
required: true
|
||||||
|
|
||||||
region:
|
region:
|
||||||
description: "STACKIT region for tests"
|
description: "STACKIT region for tests"
|
||||||
default: 'eu01'
|
default: 'eu01'
|
||||||
|
|
@ -19,11 +39,18 @@ inputs:
|
||||||
service_account_json:
|
service_account_json:
|
||||||
description: "STACKIT service account JSON file contents"
|
description: "STACKIT service account JSON file contents"
|
||||||
required: true
|
required: true
|
||||||
|
default: ""
|
||||||
|
|
||||||
|
service_account_json_file_path:
|
||||||
|
description: "STACKIT service account JSON file contents"
|
||||||
|
required: true
|
||||||
|
default: "~/.stackit/credentials.json"
|
||||||
|
|
||||||
test_file:
|
test_file:
|
||||||
description: "testfile to run"
|
description: "testfile to run"
|
||||||
default: ''
|
default: ''
|
||||||
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
random-number:
|
random-number:
|
||||||
description: "Random number"
|
description: "Random number"
|
||||||
|
|
@ -51,7 +78,7 @@ runs:
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
|
|
||||||
- name: Install Go ${{ inputs.go-version }}
|
- name: Install Go ${{ inputs.go-version }}
|
||||||
uses: https://code.forgejo.org/actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
# go-version: ${{ inputs.go-version }}
|
# go-version: ${{ inputs.go-version }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
@ -78,47 +105,55 @@ runs:
|
||||||
- name: Crete service account file
|
- name: Crete service account file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "${{ inputs.service_account_json }}" > ~/.service_account.json
|
echo "${{ inputs.service_account_json }}" > "${{ inputs.service_account_json_file_path }}"
|
||||||
cat ~/.service_account.json
|
cat "${{ inputs.service_account_json_file_path }}"
|
||||||
|
|
||||||
- name: Run acceptance test file
|
- name: Run acceptance test file
|
||||||
if: ${{ inputs.test_file != '' }}
|
if: ${{ inputs.test_file != '' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Running acceptance tests for the terraform provider"
|
echo "Running acceptance tests for the terraform provider"
|
||||||
echo "${STACKIT_SERVICE_ACCOUNT_JSON}" > ~/.service_account.json
|
|
||||||
cd stackit
|
cd stackit
|
||||||
TF_ACC=1 \
|
TF_ACC=1 \
|
||||||
TF_ACC_PROJECT_ID=${TF_ACC_PROJECT_ID} \
|
TF_ACC_PROJECT_ID=${TF_ACC_PROJECT_ID} \
|
||||||
TF_ACC_REGION=${TF_ACC_REGION} \
|
TF_ACC_REGION=${TF_ACC_REGION} \
|
||||||
|
TF_ACC_TEST_PROJECT_USER_EMAIL=${TF_ACC_TEST_PROJECT_USER_EMAIL} \
|
||||||
|
TF_ACC_KEK_KEY_ID=${TF_ACC_KEK_KEY_ID} \
|
||||||
|
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=30m
|
go test ${{ inputs.test_file }} -count=1 -timeout=30m
|
||||||
env:
|
env:
|
||||||
STACKIT_SERVICE_ACCOUNT_JSON: ${{ inputs.service_account_json }}
|
STACKIT_SERVICE_ACCOUNT_JSON: ${{ inputs.service_account_json }}
|
||||||
TF_PROJECT_ID: ${{ inputs.project_id }}
|
TF_PROJECT_ID: ${{ inputs.project_id }}
|
||||||
TF_ACC_REGION: ${{ inputs.region }}
|
TF_ACC_REGION: ${{ inputs.region }}
|
||||||
# TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_EMAIL: ${{ secrets.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_EMAIL }}
|
TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ inputs.project_user_email }}
|
||||||
# TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN }}
|
TF_ACC_KEK_KEY_ID: ${{ inputs.tf_acc_kek_key_id }}
|
||||||
# TF_ACC_TEST_PROJECT_PARENT_CONTAINER_ID: ${{ secrets.TF_ACC_TEST_PROJECT_PARENT_CONTAINER_ID }}
|
TF_ACC_KEK_KEY_RING_ID: ${{ inputs.tf_acc_kek_key_ring_id }}
|
||||||
# TF_ACC_TEST_PROJECT_PARENT_UUID: ${{ secrets.TF_ACC_TEST_PROJECT_PARENT_UUID }}
|
TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }}
|
||||||
# TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ secrets.TF_ACC_TEST_PROJECT_USER_EMAIL }}
|
TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }}
|
||||||
|
|
||||||
- name: Run acceptance tests
|
- name: Run acceptance tests
|
||||||
if: ${{ inputs.test_file == '' }}
|
if: ${{ inputs.test_file == '' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Running acceptance tests for the terraform provider"
|
echo "Running acceptance tests for the terraform provider"
|
||||||
echo "${STACKIT_SERVICE_ACCOUNT_JSON}" > ~/.service_account.json
|
|
||||||
cd stackit
|
cd stackit
|
||||||
TF_ACC=1 \
|
TF_ACC=1 \
|
||||||
TF_ACC_PROJECT_ID=${TF_ACC_PROJECT_ID} \
|
TF_ACC_PROJECT_ID=${TF_ACC_PROJECT_ID} \
|
||||||
TF_ACC_REGION=${TF_ACC_REGION} \
|
TF_ACC_REGION=${TF_ACC_REGION} \
|
||||||
|
TF_ACC_TEST_PROJECT_USER_EMAIL=${TF_ACC_TEST_PROJECT_USER_EMAIL} \
|
||||||
|
TF_ACC_KEK_KEY_ID=${TF_ACC_KEK_KEY_ID} \
|
||||||
|
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=30m
|
go test ./... -count=1 -timeout=30m
|
||||||
env:
|
env:
|
||||||
STACKIT_SERVICE_ACCOUNT_JSON: ${{ inputs.service_account_json }}
|
STACKIT_SERVICE_ACCOUNT_JSON: ${{ inputs.service_account_json }}
|
||||||
TF_PROJECT_ID: ${{ inputs.project_id }}
|
TF_PROJECT_ID: ${{ inputs.project_id }}
|
||||||
TF_ACC_REGION: ${{ inputs.region }}
|
TF_ACC_REGION: ${{ inputs.region }}
|
||||||
# TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_EMAIL: ${{ secrets.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_EMAIL }}
|
TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ inputs.project_user_email }}
|
||||||
# TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN }}
|
TF_ACC_KEK_KEY_ID: ${{ inputs.tf_acc_kek_key_id }}
|
||||||
# TF_ACC_TEST_PROJECT_PARENT_CONTAINER_ID: ${{ secrets.TF_ACC_TEST_PROJECT_PARENT_CONTAINER_ID }}
|
TF_ACC_KEK_KEY_RING_ID: ${{ inputs.tf_acc_kek_key_ring_id }}
|
||||||
# TF_ACC_TEST_PROJECT_PARENT_UUID: ${{ secrets.TF_ACC_TEST_PROJECT_PARENT_UUID }}
|
TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }}
|
||||||
# TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ secrets.TF_ACC_TEST_PROJECT_USER_EMAIL }}
|
TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }}
|
||||||
|
|
|
||||||
8
.github/workflows/tf-acc-test.yaml
vendored
8
.github/workflows/tf-acc-test.yaml
vendored
|
|
@ -24,10 +24,14 @@ jobs:
|
||||||
|
|
||||||
- name: Run Test
|
- name: Run Test
|
||||||
uses: ./.github/actions/acc_test
|
uses: ./.github/actions/acc_test
|
||||||
env:
|
|
||||||
TF_ACC_SERVICE_ACCOUNT_FILE: ~/.stackit/credentials.json
|
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
project_id: ${{ vars.TEST_PROJECT_ID }}
|
project_id: ${{ vars.TEST_PROJECT_ID }}
|
||||||
region: 'eu01'
|
region: 'eu01'
|
||||||
service_account_json: ${{ secrets.TF_ACC_SERVICE_ACCOUNT_JSON }}
|
service_account_json: ${{ secrets.TF_ACC_SERVICE_ACCOUNT_JSON }}
|
||||||
|
project_user_email: ${{ vars.TEST_PROJECT_USER_EMAIL }}
|
||||||
|
tf_acc_kek_key_id: ${{ vars.TEST_KEK_KEY_ID }}
|
||||||
|
tf_acc_kek_key_ring_id: ${{ vars.TEST_KEK_KEY_RING_ID }}
|
||||||
|
tf_acc_kek_key_version: ${{ vars.TEST_KEK_KEY_VERSION }}
|
||||||
|
tf_acc_kek_service_account: ${{ vars.TEST_KEK_SERVICE_ACCOUNT }}
|
||||||
|
# service_account_json_file_path: ~/.stackit/credentials.json
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue