Skip to content

v2.0.0-beta7 (#209) #319

v2.0.0-beta7 (#209)

v2.0.0-beta7 (#209) #319

name: E2E on Terraform Cloud [Helm]
on:
schedule:
- cron: '30 6 * * *'
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
env:
USE_EXISTING_CLUSTER: true
CLUSTER_NAME: 'this'
DOCKER_IMAGE: 'this'
KUBECONFIG: ${{ github.workspace }}/.kube/config
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: 'go.mod'
- name: Set up kind
uses: helm/kind-action@fa81e57adff234b2908110485695db0f181f3c67 # v1.7.0
with:
wait: 2m
version: v0.18.0 # Installs Kubernetes v1.26.3
cluster_name: ${{ env.CLUSTER_NAME }}
- name: Set up Helm
uses: Azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.11.2
- name: Generate Docker image metadata
id: meta
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=sha,prefix=,format=short
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
with:
platforms: amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
- name: Build and load Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
platforms: linux/amd64
load: true
build-args:
BIN_NAME=${{ vars.BIN_NAME }}
tags: ${{ env.DOCKER_METADATA_OUTPUT_TAGS }}
- name: Upload Docker image to kind
run: |
kind load docker-image ${{ env.DOCKER_METADATA_OUTPUT_TAGS }} --name ${{ env.CLUSTER_NAME }}
- name: Install Helm chart
run: |
helm install --wait --timeout 1m this ./charts/terraform-cloud-operator \
--set operator.image.repository=${{ env.DOCKER_IMAGE }} \
--set operator.image.tag=${{ env.DOCKER_METADATA_OUTPUT_VERSION }} \
--set operator.syncPeriod=30s \
--set controllers.agentPool.workers=5 \
--set controllers.module.workers=5 \
--set controllers.workspace.workers=5
- name: Run end-to-end test suite
run: make test
env:
TFC_OAUTH_TOKEN: ${{ secrets.TFC_OAUTH_TOKEN }}
TFC_ORG: ${{ secrets.TFC_ORG }}
TFC_TOKEN: ${{ secrets.TFC_TOKEN }}
TFC_VCS_REPO: ${{ secrets.TFC_VCS_REPO }}