mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-03-28 10:02:17 +08:00
Bumps the actions group in /.github/workflows with 4 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action), [actions/stale](https://github.com/actions/stale) and [actions/setup-python](https://github.com/actions/setup-python). Updates `actions/checkout` from 6.0.0 to 6.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](1af3b93b68...8e8c483db8) Updates `github/codeql-action` from 4.31.5 to 4.31.7 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](fdbfb4d275...cf1bb45a27) Updates `actions/stale` from 10.1.0 to 10.1.1 - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](5f858e3efb...997185467f) Updates `actions/setup-python` from 6.0.0 to 6.1.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](e797f83bcb...83679a892e) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/codeql-action dependency-version: 4.31.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/stale dependency-version: 10.1.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/setup-python dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
86 lines
4.0 KiB
YAML
86 lines
4.0 KiB
YAML
name: Cluster Integration Tests - private cluster
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- 'releases/*'
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
run-integration-test:
|
|
name: Run Minikube Integration Tests
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
KUBECONFIG: /home/runner/.kube/config
|
|
NAMESPACE: test-${{ github.run_id }}
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
rm -rf node_modules/
|
|
npm install
|
|
- name: Install ncc
|
|
run: npm i -g @vercel/ncc
|
|
- name: Build
|
|
run: ncc build src/run.ts -o lib
|
|
- name: Azure login
|
|
uses: azure/login@v2.3.0
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
|
|
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
|
|
name: Install Kubectl
|
|
|
|
- name: Create private AKS cluster and set context
|
|
run: |
|
|
set +x
|
|
# create cluster
|
|
az group create --location eastus2 --name ${{ env.NAMESPACE }}
|
|
az aks create --name ${{ env.NAMESPACE }} --resource-group ${{ env.NAMESPACE }} --enable-private-cluster --generate-ssh-keys
|
|
az aks get-credentials --resource-group ${{ env.NAMESPACE }} --name ${{ env.NAMESPACE }}
|
|
|
|
- name: Create namespace to run tests
|
|
run: |
|
|
az aks command invoke --resource-group ${{ env.NAMESPACE }} --name ${{ env.NAMESPACE }} --command "kubectl create ns ${{ env.NAMESPACE }}"
|
|
|
|
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
|
|
name: Install Python
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Executing deploy action for pod
|
|
uses: ./
|
|
with:
|
|
namespace: ${{ env.NAMESPACE }}
|
|
images: nginx:1.14.2
|
|
manifests: |
|
|
test/integration/manifests/test.yml
|
|
test/integration/manifests/test2.yml
|
|
action: deploy
|
|
private-cluster: true
|
|
resource-group: ${{ env.NAMESPACE }}
|
|
name: ${{ env.NAMESPACE }}
|
|
|
|
- name: Checking if deployments and services were created
|
|
run: |
|
|
python test/integration/k8s-deploy-test.py private=${{ env.NAMESPACE }} namespace=${{ env.NAMESPACE }} kind=Deployment name=nginx-deployment containerName=nginx:1.14.2 labels=app:nginx,workflow:actions.github.com-k8s-deploy,workflowFriendlyName:Cluster_Integration_Tests_-_private_cluster selectorLabels=app:nginx
|
|
python test/integration/k8s-deploy-test.py private=${{ env.NAMESPACE }} namespace=${{ env.NAMESPACE }} kind=Service name=nginx-service labels=workflow:actions.github.com-k8s-deploy,workflowFriendlyName:Cluster_Integration_Tests_-_private_cluster selectorLabels=app:nginx
|
|
|
|
python test/integration/k8s-deploy-test.py private=${{ env.NAMESPACE }} namespace=${{ env.NAMESPACE }} kind=Deployment name=nginx-deployment2 containerName=nginx:1.14.2 labels=app:nginx2,workflow:actions.github.com-k8s-deploy,workflowFriendlyName:Cluster_Integration_Tests_-_private_cluster selectorLabels=app:nginx2
|
|
python test/integration/k8s-deploy-test.py private=${{ env.NAMESPACE }} namespace=${{ env.NAMESPACE }} kind=Service name=nginx-service2 labels=workflow:actions.github.com-k8s-deploy,workflowFriendlyName:Cluster_Integration_Tests_-_private_cluster selectorLabels=app:nginx2
|
|
|
|
- name: Clean up AKS cluster
|
|
if: ${{ always() }}
|
|
run: |
|
|
echo "deleting AKS cluster and resource group"
|
|
az aks delete --yes --resource-group ${{ env.NAMESPACE }} --name ${{ env.NAMESPACE }}
|
|
az group delete --resource-group ${{ env.NAMESPACE }} --yes
|