Add shopware commands #98
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 | |
on: | |
pull_request: | |
permissions: | |
contents: read | |
pull-requests: read | |
checks: write | |
jobs: | |
golangci: | |
name: golangci | |
runs-on: runs-on=${{ github.run_id }}/runner=sw-amd64/cpu=1 | |
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: runs-on=${{ github.run_id }}/runner=sw-amd64/cpu=1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Run go tests | |
run: go test ./... | |
helm-lint: | |
name: helm lint | |
runs-on: runs-on=${{ github.run_id }}/runner=sw-amd64/cpu=1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Set up Helm | |
uses: azure/[email protected] | |
with: | |
version: v3.16.4 | |
- name: helm lint | |
run: | | |
make helm path=test version=99.99.98 | |
cd test | |
helm lint . | |
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@v4 | |
# Needed for controler runtime and goreleaser | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Remove arm from goreleaser | |
uses: mikefarah/yq@master | |
with: | |
cmd: yq -i 'del(.dockers.[1])' .goreleaser.yaml | |
- 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 | |
with: | |
registry: true | |
registry_name: kind-registry | |
registry_port: 5001 | |
registry_enable_delete: true | |
- name: Run chart-testing (install) | |
run: | | |
version="${{ fromJSON(steps.goreleaser.outputs.metadata).version }}-amd64" | |
echo Using version $version for image version | |
kind load docker-image --name chart-testing ghcr.io/shopware/shopware-operator:$version | |
make helm path=test version=99.99.98 | |
helm lint test | |
kubectl create namespace test | |
helm install test --namespace test test --set image.tag="$version" | |
kubectl wait --namespace test --for=condition=Available --timeout=20s deployment/test-shopware-operator | |
kubectl get deployment --namespace test -o wide | |
kubectl rollout status --namespace test deployment/test-shopware-operator --timeout=60s | |
kubectl get pods --namespace test -o wide | |
kubectl get pods --namespace test -o=custom-columns='IMAGE:spec.containers[0].image' | |
kubectl apply -f examples | |
kubectl wait --namespace test --for=jsonpath="{.status.state}"=running --timeout=1m storeexec/test-cron | |
kubectl wait --namespace test --for=jsonpath="{.status.state}"=done --timeout=1m storeexec/test |