Skip to content

Commit

Permalink
Merge pull request #756 from wso2/tharindu1st-patch-2
Browse files Browse the repository at this point in the history
Create integration-test.yml
  • Loading branch information
tharindu1st authored Feb 27, 2023
2 parents 157f937 + 2e3a017 commit e0ca79e
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: start and run postman collection
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Create AKS Cluster and set context
uses: azure/CLI@v1
with:
azcliversion: 2.44.1
inlineScript: |
az aks create --resource-group "${{ secrets.AZURE_RESOURCE_GROUP }}" --name "${{ secrets.AKS_CLUSTER_NAME }}" --enable-cluster-autoscaler --min-count 1 --max-count 3 --location "southeastasia" --generate-ssh-keys --verbose
- uses: azure/aks-set-context@v3
with:
resource-group: '${{ secrets.AZURE_RESOURCE_GROUP }}'
cluster-name: '${{ secrets.AKS_CLUSTER_NAME }}'
- name: Create Namespace apk-release
shell: sh
run: |
kubectl create namespace apk-release
kubectl get ns
- name: Checkout apk-repo.
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
token: ${{ secrets.WSO2_BOT_TOKEN }}
- name: Helm release deploy
shell: sh
run: |
cd apk-repo/helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add jetstack https://charts.jetstack.io
helm dependency build
helm install release-1 -n apk-release . --debug --wait --timeout 10m0s
kubectl get pods -n apk-release
kubectl get svc -n apk-release
- name: Apply test resources
shell: sh
run: |
cd apk-repo/test/k8s-resources
kubectl apply -f .
- name: Retrieve Router IP
id: retrieveIp
run: |
echo "router_ip=`kubectl get svc release-1-wso2-apk-router-service -n apk-release --output jsonpath='{.status.loadBalancer.ingress[0].ip}'`">> $GITHUB_OUTPUT
- name: Run test cases
shell: sh
run: |
cd apk-repo/test/postman-tests
./gradlew test -PgwHost=${{ steps.retrieveIp.outputs.router_ip }}
- name: Helm release undeploy
if: always()
shell: sh
run: |
cd apk-repo/helm-charts
helm uninstall release-1 -n apk-release
kubectl get pods -n apk-release
kubectl get svc -n apk-release
- name: Delete AKS cluster
if: always()
uses: azure/CLI@v1
with:
azcliversion: 2.44.1
inlineScript: |
az aks delete --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} --name ${{ secrets.AKS_CLUSTER_NAME }} --yes
- name: Logout from azure
if: always()
uses: azure/CLI@v1
with:
azcliversion: 2.44.1
inlineScript: |
az logout
- name: Publish Test Report
if: always()
uses: malinthaprasan/action-surefire-report@v1
with:
report_paths: 'apk-repo/test/postman-tests/build/*.xml'
- name: Archive testng report
if: always()
uses: actions/upload-artifact@v2
with:
path: |
report_paths: 'apk-repo/test/postman-tests/build/*.xml'
if-no-files-found: warn

0 comments on commit e0ca79e

Please sign in to comment.