mirror of
https://github.com/imjasonh/snoop
synced 2026-07-19 07:04:01 +00:00
Use azure/setup-kubectl action instead of manual download
This commit is contained in:
parent
0f7645fabe
commit
2beb26da3f
1 changed files with 43 additions and 44 deletions
87
.github/workflows/kind-tests.yaml
vendored
87
.github/workflows/kind-tests.yaml
vendored
|
|
@ -2,64 +2,63 @@ name: KinD Integration Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
kind-tests:
|
kind-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.21'
|
go-version: "1.21"
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Install KinD
|
- name: Install KinD
|
||||||
run: |
|
run: |
|
||||||
# Install KinD
|
# Install KinD
|
||||||
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
|
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
|
||||||
chmod +x ./kind
|
chmod +x ./kind
|
||||||
sudo mv ./kind /usr/local/bin/kind
|
sudo mv ./kind /usr/local/bin/kind
|
||||||
|
|
||||||
- name: Install kubectl
|
- name: Set up kubectl
|
||||||
run: |
|
uses: azure/setup-kubectl@v4
|
||||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
with:
|
||||||
chmod +x kubectl
|
version: "latest"
|
||||||
sudo mv kubectl /usr/local/bin/kubectl
|
|
||||||
|
|
||||||
- name: Install jq
|
- name: Install jq
|
||||||
run: sudo apt-get update && sudo apt-get install -y jq
|
run: sudo apt-get update && sudo apt-get install -y jq
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build -t snoop:ci-test .
|
docker build -t snoop:ci-test .
|
||||||
|
|
||||||
- name: Set up KinD cluster
|
- name: Set up KinD cluster
|
||||||
run: |
|
run: |
|
||||||
cd test/kind
|
cd test/kind
|
||||||
./setup.sh snoop:ci-test
|
./setup.sh snoop:ci-test
|
||||||
|
|
||||||
- name: Run KinD integration tests
|
- name: Run KinD integration tests
|
||||||
run: |
|
run: |
|
||||||
cd test/kind
|
cd test/kind
|
||||||
IMAGE_TAG=snoop:ci-test ./run-tests.sh
|
IMAGE_TAG=snoop:ci-test ./run-tests.sh
|
||||||
|
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: kind-test-results
|
name: kind-test-results
|
||||||
path: test/kind/results/
|
path: test/kind/results/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
- name: Clean up
|
- name: Clean up
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
kind delete cluster --name snoop-test || true
|
kind delete cluster --name snoop-test || true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue