generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
123 lines (116 loc) · 5 KB
/
_integration-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: integration tests
on:
workflow_call:
inputs:
image:
description: 'The image to test'
required: true
type: string
trigger_btp:
description: 'Trigger BTP integration test'
required: false
type: boolean
default: false
jobs:
operator-integration-test:
if: ${{ !startsWith(github.event_name, 'pull_request') || github.event.pull_request.draft == false }}
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/create-k3d-cluster
- name: run test
run: |
make -C components/operator deploy
make -C tests/operator test
env:
IMG: ${{ inputs.image }}
- if: ${{ always() }}
uses: ./.github/actions/collect-cluster-info
serverless-integration-test:
if: ${{ !startsWith(github.event_name, 'pull_request') || github.event.pull_request.draft == false }}
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/create-k3d-cluster
- name: run test
run: |
make install-serverless-custom-operator
make -C tests/serverless serverless-integration serverless-contract-tests
make remove-serverless
env:
IMG: ${{ inputs.image }}
git-auth-integration-test:
if: ${{ !startsWith(github.event_name, 'pull_request') || github.event.pull_request.draft == false }}
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/create-k3d-cluster
- name: run tests
run: |
make install-serverless-custom-operator
make -C tests/serverless git-auth-integration
make remove-serverless
env:
APP_TEST_GITHUB_SSH_AUTH_KEY: ${{ secrets.GIT_AUTH_TEST_GITHUB_SSH_KEY }}
APP_TEST_AZURE_BASIC_AUTH_USERNAME: ${{ secrets.GIT_AUTH_TEST_AZURE_USERNAME }}
APP_TEST_AZURE_BASIC_AUTH_PASSWORD: ${{ secrets.GIT_AUTH_TEST_AZURE_PASSWORD }}
IMG: ${{ inputs.image }}
btp-integration-test:
if: ${{ inputs.trigger_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
- name: compute github commit sha
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- uses: kyma-project/terraform-module/.github/actions/create-sap-btp-kyma@2edb264e0f701fc93af4fb35eaeb7b8b3c05e493
id: create-btp-resources
with:
btp_subaccount_name: serverless-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 }}'
btp_kyma_modules: "[]"
btp_kyma_autoscaler_min: 4
- name: run tests
run: |
make install-serverless-custom-operator
make -C tests/serverless serverless-integration
kubectl delete functions.serverless.kyma-project.io -A --all
make -C tests/serverless git-auth-integration
kubectl delete functions.serverless.kyma-project.io -A --all
env:
IMG: ${{ inputs.image }}
APP_TEST_GITHUB_SSH_AUTH_KEY: ${{ secrets.GIT_AUTH_TEST_GITHUB_SSH_KEY }}
APP_TEST_AZURE_BASIC_AUTH_USERNAME: ${{ secrets.GIT_AUTH_TEST_AZURE_USERNAME }}
APP_TEST_AZURE_BASIC_AUTH_PASSWORD: ${{ secrets.GIT_AUTH_TEST_AZURE_PASSWORD }}
- uses: kyma-project/terraform-module/.github/actions/force-delete-sap-btp-subaccount@2edb264e0f701fc93af4fb35eaeb7b8b3c05e493
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 }}