feat: Add GitHub Actions workflow for artifact management and contain… #36
This file contains hidden or 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: E2E Tests | |
on: | |
push: | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
jobs: | |
test-e2e: | |
name: E2E Tests | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Clone the code | |
uses: actions/checkout@v4.2.2 | |
- name: Setup Go | |
uses: actions/setup-go@v5.4.0 | |
with: | |
go-version-file: go.mod | |
- name: Install go-task | |
run: | | |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin | |
- name: Install k3d | |
run: | | |
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash | |
- name: Install ctlptl | |
run: | | |
CTLPTL_VERSION=0.8.40 | |
curl -fsSL -o /tmp/ctlptl.tar.gz https://github.com/tilt-dev/ctlptl/releases/download/v${CTLPTL_VERSION}/ctlptl.${CTLPTL_VERSION}.linux.x86_64.tar.gz | |
tar -xzf /tmp/ctlptl.tar.gz | |
sudo mv ctlptl /usr/local/bin/ | |
sudo chmod +x /usr/local/bin/ctlptl | |
- name: Install controller-gen, kustomize, and setup-envtest | |
run: | | |
CONTROLLER_GEN_VERSION=v0.17.2 | |
KUSTOMIZE_VERSION=v5.6.0 | |
ENVTEST_VERSION=latest | |
# Install controller-gen globally | |
go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION} | |
# Install kustomize globally | |
go install sigs.k8s.io/kustomize/kustomize/v5@${KUSTOMIZE_VERSION} | |
# Install setup-envtest globally | |
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@${ENVTEST_VERSION} | |
# Verify installations | |
controller-gen --version || (echo "controller-gen not installed" && exit 1) | |
kustomize version || (echo "kustomize not installed" && exit 1) | |
setup-envtest version || (echo "setup-envtest not installed" && exit 1) | |
- name: Setup K8s envtest binaries | |
run: | | |
ENVTEST_K8S_VERSION=1.32 | |
# Create bin directory for K8s binaries | |
mkdir -p bin | |
# Setup K8s test binaries | |
setup-envtest use ${ENVTEST_K8S_VERSION} -p path | |
- name: Verify k3d and ctlptl installation | |
run: | | |
k3d version | |
ctlptl version | |
- name: Create k3d cluster with ctlptl | |
run: | | |
task cluster:create | |
- name: Running Test e2e | |
run: | | |
go mod tidy | |
# Run generate and manifests targets separately | |
task generate | |
task manifests | |
task test-e2e |