aks-engine/.github/workflows/test-cluster-config.yaml

89 строки
3.5 KiB
YAML

name: Test Cluster Config
on:
workflow_dispatch:
inputs:
cluster_config:
description: 'Path to example api model? (e.g., examples/kubernetes-gpu/kubernetes.json)'
required: true
ginkgo_focus:
description: 'E2E tests to run (e.g., "should be able to run a nvidia-gpu job")'
required: false
default: ''
ginkgo_skip:
description: 'E2E tests to skip (e.g., "should have the expected k8s version")'
required: false
default: ''
kubernetes_release:
description: 'Which Kubernetes release to test (major.minor only, e.g., "1.24")'
required: false
default: '1.24'
container_runtime:
description: 'Which CRI to use (e.g., "containerd" or "docker")'
required: false
default: 'containerd'
azure_region:
description: 'Which Azure region to create cluster in (e.g., "westus2")'
required: false
default: 'westus2'
cleanup_on_exit:
description: 'Delete cluster resources after test completes'
required: false
default: true
cleanup_if_fail:
description: 'Delete cluster resources if test fails'
required: false
default: true
from_branch:
description: 'Which branch to run tests from? (default: master)'
required: false
default: 'master'
jobs:
run-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{github.event.inputs.from_branch}}
- name: validate cluster config
run: ls -la ${{github.event.inputs.cluster_config}}
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
- name: install go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Install helm
run: |
curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
- name: Install k
run: |
sudo curl -o /usr/local/bin/k https://raw.githubusercontent.com/jakepearson/k/master/k
sudo chmod +x /usr/local/bin/k
- name: Build aks-engine binary
run: make build-binary
- name: Run E2E
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
ORCHESTRATOR_RELEASE: ${{ github.event.inputs.kubernetes_release }}
CLUSTER_DEFINITION: ${{ github.event.inputs.cluster_config }}
GINKGO_FOCUS: ${{ github.event.inputs.ginkgo_focus }}
GINKGO_SKIP: ${{ github.event.inputs.ginkgo_skip }}
SUBSCRIPTION_ID: ${{ secrets.TEST_AZURE_SUB_ID }}
CLIENT_ID: ${{ secrets.TEST_AZURE_SP_ID }}
CLIENT_SECRET: ${{ secrets.TEST_AZURE_SP_PW }}
LOCATION: ${{ github.event.inputs.azure_region }}
TENANT_ID: ${{ secrets.TEST_AZURE_TENANT_ID }}
CLEANUP_ON_EXIT: ${{ github.event.inputs.cleanup_on_exit }}
CLEANUP_IF_FAIL: ${{ github.event.inputs.cleanup_if_fail }}
CONTAINER_RUNTIME: ${{ github.event.inputs.container_runtime }}
SKIP_LOGS_COLLECTION: true
AZURE_CORE_ONLY_SHOW_ERRORS: True
run: make test-kubernetes