mirror of
https://github.com/Azure/setup-kubectl.git
synced 2026-05-22 17:02:04 +00:00
85 lines
No EOL
2.7 KiB
YAML
85 lines
No EOL
2.7 KiB
YAML
name: Integration test for setup-kubectl
|
|
on: # rebuild any PRs and main branch changes
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- 'releases/*'
|
|
push:
|
|
branches:
|
|
- main
|
|
- 'releases/*'
|
|
|
|
jobs:
|
|
run-integration-test:
|
|
name: Validate release and master branch
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
KUBECONFIG: /home/runner/.kube/config
|
|
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
name: Checkout from PR branch
|
|
|
|
- id: action-npm-build
|
|
name: npm install and build
|
|
run: |
|
|
echo $PR_BASE_REF
|
|
if [[ $PR_BASE_REF != releases/* ]]; then
|
|
npm install
|
|
npm run build
|
|
# remove node_modules to match production environment where only index.js is present
|
|
rm -rf node_modules
|
|
fi
|
|
|
|
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
name: Install Python
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install requests library
|
|
run: pip install requests
|
|
|
|
- name: Setup kubectl latest
|
|
uses: ./
|
|
with:
|
|
version: 'latest'
|
|
|
|
- name: Validate kubectl setup
|
|
run: python test/validate-kubectl.py latest
|
|
|
|
- name: Setup kubectl old version
|
|
uses: ./
|
|
with:
|
|
version: 'v1.15.1'
|
|
|
|
- name: Validate kubectl setup old version
|
|
run: python test/validate-kubectl.py 'v1.15.1'
|
|
|
|
- name: Fetch known SHA256 for v1.30.0 linux/amd64
|
|
id: sha
|
|
run: |
|
|
value=$(curl -fsSL https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubectl.sha256)
|
|
echo "value=$value" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Setup kubectl with valid checksum
|
|
uses: ./
|
|
with:
|
|
version: 'v1.30.0'
|
|
checksum: ${{ steps.sha.outputs.value }}
|
|
|
|
- name: Validate kubectl setup with checksum
|
|
run: python test/validate-kubectl.py 'v1.30.0'
|
|
|
|
- name: Setup kubectl with bad checksum (expect failure)
|
|
id: badsum
|
|
continue-on-error: true
|
|
uses: ./
|
|
with:
|
|
version: 'v1.29.0'
|
|
checksum: 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
|
|
|
|
- name: Assert bad-checksum step failed
|
|
if: steps.badsum.outcome != 'failure'
|
|
run: |
|
|
echo "Expected bad-checksum step to fail, but outcome was: ${{ steps.badsum.outcome }}"
|
|
exit 1 |