Bump golang from 1.20.5 to 1.21.4 #237
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Test Chart | |
on: pull_request | |
jobs: | |
go-test: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE: jainishshah17/tugger | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "^1.13.0" | |
- name: go test | |
run: | | |
cd cmd/tugger | |
go test . -cover -v | |
lint-test: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE: jainishshah17/tugger | |
strategy: | |
fail-fast: false | |
matrix: | |
k8sVersion: | |
- v1.28.0 | |
- v1.27.3 | |
- v1.26.6 | |
- v1.25.11 | |
- v1.24.15 | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Helm | |
uses: azure/[email protected] | |
- name: Lint Chart | |
run: helm lint chart/* -f chart/*/ci/lint-values.yaml | |
- name: Build | |
run: docker build . -t $IMAGE | |
- name: Create kind cluster | |
uses: helm/[email protected] | |
with: | |
node_image: kindest/node:${{ matrix.k8sVersion }} | |
- name: Install | |
run: | | |
kind load docker-image $IMAGE --name=chart-testing | |
helm install $USER chart/tugger --debug --wait \ | |
--set=createMutatingWebhook=true \ | |
--set=image.tag=latest | |
- name: Test Mutation | |
timeout-minutes: 1 | |
run: | | |
function test_jsonpath() { | |
until [ "$1" = "$(kubectl -n nginx get po -l test=tugger -o jsonpath="$2")" ] | |
do | |
echo "test failed \"$1\" = \"$2\"" | |
sleep 1 | |
done | |
} | |
kubectl apply -f test/nginx.yaml | |
test_jsonpath "jainishshah17/nginx" '{.items[0].spec.containers[0].image}' | |
test_jsonpath "original-secret" '{.items[0].spec.imagePullSecrets[0].name}' | |
test_jsonpath "regsecret" '{.items[0].spec.imagePullSecrets[1].name}' | |
- name: Print debug | |
if: ${{ always() }} | |
run: | | |
set +x | |
while read cmd | |
do | |
echo "::group::$cmd" | |
$cmd | |
echo "::endgroup::" | |
done <<< 'git diff | |
helm list | |
kubectl get po,rs,svc,ep,secrets,configmap | |
kubectl describe po | |
kubectl logs -l app=tugger' |