Skip to content

πŸ’ Fixed channels display for module catalog command (#2814) (#2825) #34

πŸ’ Fixed channels display for module catalog command (#2814) (#2825)

πŸ’ Fixed channels display for module catalog command (#2814) (#2825) #34

name: btp integration tests
permissions:
id-token: write # Required to receive OIDC tokens
on:
workflow_dispatch:
push:
branches:
- 'release-*'
jobs:
e2e-test-btp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/ensure-pack
- name: compute github commit sha
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: build kyma CLI binary
run: make build
- uses: kyma-project/terraform-module/.github/actions/[email protected]
id: create-btp-resources
with:
btp_subaccount_name: cli-test-${{ steps.vars.outputs.sha_short }}-${{ github.run_attempt }}
btp_backend_url: '${{ secrets.BTP_BACKEND_URL}}'
btp_user: '${{ secrets.BTP_BOT_USER}}'
btp_password: '${{ secrets.BTP_BOT_PASSWORD}}'
btp_global_account: '${{ secrets.BTP_GLOBAL_ACCOUNT }}'
btp_idp_tenant: '${{ secrets.BTP_CUSTOM_IAS_TENANT }}'
btp_subaccount_region: '${{ secrets.BTP_SUBACCOUNT_REGION }}'
btp_kyma_region: '${{ secrets.BTP_KYMA_REGION }}'
btp_kyma_plan: '${{ secrets.BTP_KYMA_PLAN }}'
- name: test gh oidc trust
run: |
echo -e "Testing access generated for github as trusted OIDC using alpha authorize repository command \n"
AUDIENCE="gh-oidc-test"
REPOSITORY="kyma-project/cli"
# WHEN - Use the new alpha authorize repository command to establish trust
bin/kyma alpha authorize repository --repository $REPOSITORY --client-id $AUDIENCE --cluster-wide --clusterrole cluster-admin
# THEN - Generate kubeconfig and test access
bin/kyma alpha kubeconfig generate --audience $AUDIENCE --output /tmp/kubeconfig-gh-token.yaml
kubectl auth can-i update kymas --kubeconfig /tmp/kubeconfig-gh-token.yaml
kubectl get kymas -A -oyaml --kubeconfig /tmp/kubeconfig-gh-token.yaml
- name: ensure btp prerequisites
run: |
echo -e "BTP_GLOBAL_ACCOUNT = \"$BTP_GLOBAL_ACCOUNT\"" >> tests/btp/tf/.tfvars
echo -e "BTP_BOT_USER = \"$BTP_BOT_USER\"" >> tests/btp/tf/.tfvars
echo -e "BTP_BOT_PASSWORD = \"$BTP_BOT_PASSWORD\"" >> tests/btp/tf/.tfvars
echo -e "BTP_BACKEND_URL = \"$BTP_BACKEND_URL\"" >> tests/btp/tf/.tfvars
echo -e "BTP_CUSTOM_IAS_TENANT = \"$BTP_CUSTOM_IAS_TENANT\"" >> tests/btp/tf/.tfvars
echo -e "BTP_KYMA_SUBACCOUNT_ID = \"$BTP_KYMA_SUBACCOUNT_ID\"" >> tests/btp/tf/.tfvars
echo -e "BTP_OBJECTSTORE_SUBACCOUNT_ID = \"$BTP_OBJECTSTORE_SUBACCOUNT_ID\"" >> tests/btp/tf/.tfvars
echo -e "BTP_HANA_SUBACCOUNT_ID = \"$BTP_HANA_SUBACCOUNT_ID\"" >> tests/btp/tf/.tfvars
make -C tests/btp prerequisites
env:
BTP_BACKEND_URL: '${{ secrets.BTP_BACKEND_URL}}'
BTP_BOT_USER: '${{ secrets.BTP_BOT_USER}}'
BTP_BOT_PASSWORD: '${{ secrets.BTP_BOT_PASSWORD}}'
BTP_CUSTOM_IAS_TENANT: '${{ secrets.BTP_CUSTOM_IAS_TENANT }}'
BTP_GLOBAL_ACCOUNT: '${{ secrets.BTP_GLOBAL_ACCOUNT }}'
BTP_KYMA_SUBACCOUNT_ID: '${{ steps.create-btp-resources.outputs.subaccount_id }}'
BTP_OBJECTSTORE_SUBACCOUNT_ID: '${{ secrets.BTP_OBJECTSTORE_SUBACCOUNT_ID }}'
BTP_HANA_SUBACCOUNT_ID: '${{ secrets.BTP_HANA_SUBACCOUNT_ID }}'
- name: test
run: |
make -C tests/btp e2e-test
- name: cleanup
run: |
make -C tests/btp cleanup
- uses: kyma-project/terraform-module/.github/actions/[email protected]
if: always()
with:
btp_subaccount_id: ${{ steps.create-btp-resources.outputs.subaccount_id }}
btp_backend_url: ${{ secrets.BTP_BACKEND_URL}}
btp_user: ${{ secrets.BTP_BOT_USER}}
btp_password: ${{ secrets.BTP_BOT_PASSWORD}}
btp_global_account: ${{ secrets.BTP_GLOBAL_ACCOUNT }}
btp_idp_tenant: ${{ secrets.BTP_CUSTOM_IAS_TENANT }}