diff --git a/.github/workflows/kor-ci.yaml b/.github/workflows/kor-ci.yaml new file mode 100644 index 00000000..e05305d8 --- /dev/null +++ b/.github/workflows/kor-ci.yaml @@ -0,0 +1,43 @@ +name: Kor CI Test + +on: + pull_request: + branches: [main] + +jobs: + kor-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.23.2' + + - name: Set up Kind cluster + uses: helm/kind-action@v1.8.0 + + - name: Deploy test resources via kubectl commands + run: | + kubectl create deployment nginx --image=nginx --replicas=0 + kubectl expose deployment nginx --port=80 --target-port=80 + echo "=== Resources created ===" + kubectl get all + + - name: Run kor all before deletion + run: | + echo "=== kor output BEFORE delete ===" + go run main.go all + + - name: Run kor all --delete + run: | + echo "=== Running kor all --delete ===" + go run main.go all --delete --no-interactive + + - name: Run kor all after deletion + run: | + echo "=== kor output AFTER delete ===" + go run main.go all