Skip to content

feat: add helm tests #86

feat: add helm tests

feat: add helm tests #86

Workflow file for this run

name: Lint
on:
pull_request:
# paths:
# - '**.go'
permissions:
contents: read
pull-requests: read
checks: write
jobs:
# golangci:
# name: golangci
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-go@v5
# with:
# go-version: stable
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v6
# with:
# version: v1.60
# args: --timeout=8m --verbose
#
# go-test:
# name: go test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Setup Go
# uses: actions/setup-go@v5
# with:
# check-latest: true
# - name: Run go tests
# run: go test ./...
test-on-cluster:
name: Cluster E2E Test
runs-on: runs-on=${{ github.run_id }}/runner=sw-amd64/cpu=4
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Needed for controler runtime and goreleaser
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
# - name: Remove arm in goreleaser yaml
# run: |
# echo TODO
- name: Create Snapshot
id: goreleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v1"
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.16.4
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
- name: Run chart-testing (install)
run: |
version="${{ fromJSON(steps.goreleaser.outputs.metadata).version }}-amd64"
kind load docker-image ghcr.io/shopware/shopware-operator:$version
make helm path=test version=99.99.98
cd test
kubectl create namespace test
echo Using version `$version` for image version
helm install test --namespace test . --set image.tag="$version"
kubectl wait --namespace test --for=condition=Available --timeout=20s deployment/test-shopware-operator
kubectl get deployment --namespace test -o json
kubectl rollout status --namespace test deployment/test-shopware-operator --timeout=60s
kubectl get pods --namespace test -o json