Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/test-e2e-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,28 @@ concurrency:
on:
pull_request:
paths:
- '**.go'
- 'charts/**'
- 'test/e2e-helm/**'
- 'test/utils/**'
- 'Dockerfile'
- '.dockerignore'
- 'hack/boilerplate.go.txt'
- 'Makefile'
- 'go.mod'
- 'go.sum'
- '.github/workflows/test-e2e-helm.yml'
push:
branches:
- main
paths:
- '**.go'
- 'charts/**'
- 'test/e2e-helm/**'
- 'test/utils/**'
- 'Dockerfile'
- '.dockerignore'
- 'hack/boilerplate.go.txt'
- 'Makefile'
- 'go.mod'
- 'go.sum'
Expand Down Expand Up @@ -56,6 +76,29 @@ jobs:
install_only: true
version: ${{ env.KIND_VERSION }}

- name: Prepare image inputs
run: make generate fmt

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
with:
driver-opts: default-load=true

- name: Build controller image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
load: true
push: false
pull: true
tags: lifecycle-controller-helm-e2e:v0.0.1
cache-from: type=gha,scope=helm-e2e
cache-to: type=gha,scope=helm-e2e,mode=max,ignore-error=true

- name: Run Helm E2E tests
env:
# Reuse the cache for the suite's make docker-build calls.
BUILDX_BUILDER: ${{ steps.buildx.outputs.name }}
run: |
make test-e2e-helm
27 changes: 25 additions & 2 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,30 @@ jobs:
- name: Verify kind installation
run: kind version

- name: Run E2E tests
- name: Prepare image inputs
run: |
go mod tidy
make test-e2e
make generate fmt

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
with:
driver-opts: default-load=true

- name: Build controller image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
load: true
push: false
pull: true
tags: ghcr.io/cstanislawski/lifecycle-controller:dev
cache-from: type=gha,scope=controller-e2e
cache-to: type=gha,scope=controller-e2e,mode=max,ignore-error=true

- name: Run E2E tests
env:
# Reuse the cache for the suite's make docker-build calls.
BUILDX_BUILDER: ${{ steps.buildx.outputs.name }}
run: make test-e2e
7 changes: 7 additions & 0 deletions .github/workflows/test-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ on:
- 'charts/**'
- 'Makefile'
- '.github/workflows/test-helm.yml'
push:
branches:
- main
paths:
- 'charts/**'
- 'Makefile'
- '.github/workflows/test-helm.yml'

permissions: {}

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COPY internal/ internal/
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -o manager cmd/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
Loading