Skip to content

Apply GitHub workflow changes #10

Apply GitHub workflow changes

Apply GitHub workflow changes #10

Workflow file for this run

name: Manifest acceptance tests
on:
push:
branches:
- main
paths:
- "manifest/**/*.go"
- "manifest/**/go.mod"
pull_request:
branches:
- main
paths:
- "manifest/**/*.go"
- "manifest/**/go.mod"
workflow_dispatch:
env:
KUBECONFIG: ${{ github.workspace }}/.kube/config
jobs:
acceptance_tests:
runs-on: ubuntu-latest
strategy:
# Don't cancel all in-progress and queued jobs in the matrix if any job in the matrix fails.
# That will be helpful to catch any issues related to a particular Kubernetes version.
fail-fast: false
matrix:
kubernetes_version:
# kind images: https://github.com/kubernetes-sigs/kind/releases
- v1.26.6@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
- v1.25.11@sha256:577c630ce8e509131eab1aea12c022190978dd2f745aac5eb1fe65c0807eb315
- v1.23.15@sha256:ef453bb7c79f0e3caba88d2067d4196f427794086a7d0df8df4f019d5e336b61
terraform_version:
- 1.8.0
- 1.5.7
- 1.4.7
- 1.3.10
- 1.2.9
- 1.1.9
- 1.0.11
# BONUS: Run tests on the latest available Kubernetes(1.X) and Terraform(1.X) versions.
include:
- kubernetes_version: v1.27.3@sha256:691e24bd2417609db7e589e1a479b902d2e209892a10ce375fab60a8407c7352
terraform_version: 1.6.1
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
- name: Setup kind
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
version: v0.20.0
node_image: kindest/node:${{ matrix.kubernetes_version }}
# By default, this action creates a cluster with the name 'chart-testing'
cluster_name: manifest
- name: Build annotations webhook
run: |
docker build --rm -t tf-k8s-acc-webhook ./manifest/test/acceptance/testdata/ComputedFields/webhook/
kind load docker-image tf-k8s-acc-webhook --name=manifest
- name: Run tests
env:
KUBE_CONFIG_PATH: ${{ env.KUBECONFIG }}
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform_version }}
run: |
go test -count=1 -tags acceptance -v ./manifest/test/acceptance/... -timeout 120m