Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Conformance (Main) #1530

Conformance (Main)

Conformance (Main) #1530

Workflow file for this run

name: Conformance (Main)
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}
env:
GO_VERSION: "1.19"
jobs:
run-on-environment:
runs-on: ubuntu-latest
strategy:
matrix:
cluster-type:
- kind
- eks
config:
- name: "[email protected] + [email protected]"
api-gateway-image: "hashicorppreview/consul-api-gateway:0.5-dev"
consul-image: "hashicorp/consul:1.14"
envoy-image: "envoyproxy/envoy:v1.24-latest"
consul-k8s-version: "v1.0.1"
envoy-field: "apiGateway.imageEnvoy"
- name: "[email protected] + [email protected]"
api-gateway-image: "hashicorppreview/consul-api-gateway:0.5-dev"
consul-image: "hashicorp/consul:1.15"
envoy-image: "envoyproxy/envoy:v1.25-latest"
consul-k8s-version: "v1.1.2"
envoy-field: "apiGateway.imageEnvoy"
- name: "[email protected] + [email protected]"
api-gateway-image: "hashicorppreview/consul-api-gateway:0.5-dev"
consul-image: "hashicorp/consul:1.16"
envoy-image: "envoyproxy/envoy:v1.26-latest"
consul-k8s-version: "v1.2.0"
envoy-field: "apiGateway.imageEnvoy"
fail-fast: false
name: "${{ matrix.cluster-type }} - ${{ matrix.config.name }}"
concurrency:
group: ${{ matrix.cluster-type }}
steps:
# Clone repos side-by-side:
# GITHUB_WORKSPACE/
# consul-api-gateway/
# consul-k8s/
# gateway-api/
- name: Checkout consul-api-gateway
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
path: "consul-api-gateway"
- name: Clone consul-k8s
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
repository: "hashicorp/consul-k8s"
ref: ${{ matrix.config.consul-k8s-version }}
path: "consul-k8s"
- name: Clone gateway-api
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
repository: "hashicorp/gateway-api"
ref: "conformance/v0.5.1-skipped-tests"
path: "gateway-api"
- name: Generate Unique Cluster Name
id: unique
run:
echo "::set-output name=clustername::$( echo consul-api-gateway-test-${{ github.run_number }}-$RANDOM )"
- name: Setup Kind cluster
if: matrix.cluster-type == 'kind'
uses: ./consul-api-gateway/.github/actions/setup-kind
with:
cluster-name: ${{ steps.unique.outputs.clustername }}
metallb-config-path: "./consul-api-gateway/internal/testing/conformance/metallb-config.yaml"
- name: Setup EKS cluster
if: matrix.cluster-type == 'eks'
uses: ./consul-api-gateway/.github/actions/setup-eks
with:
account_id: ${{ secrets.AWS_ACCOUNT_ID }}
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
cluster_name: ${{ steps.unique.outputs.clustername }}
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install Consul API Gateway CRDs
working-directory: "consul-api-gateway"
run: kubectl apply --kustomize="./config/crd"
- name: Install Consul
working-directory: "consul-api-gateway/internal/testing/conformance"
run: |
helm install --values ./consul-config.yaml consul $GITHUB_WORKSPACE/consul-k8s/charts/consul --set global.image=${{ matrix.config.consul-image }} --set ${{ matrix.config.envoy-field }}=${{ matrix.config.envoy-image }} --set apiGateway.image=${{ matrix.config.api-gateway-image }} --create-namespace --namespace=consul
kubectl wait --for=condition=Ready --timeout=120s --namespace=consul pods --all
- name: Patch testing resources
working-directory: "consul-api-gateway/internal/testing/conformance"
run: |
cp kustomization.yaml proxydefaults.yaml $GITHUB_WORKSPACE/gateway-api/conformance/
cd $GITHUB_WORKSPACE/gateway-api/conformance/
kubectl kustomize ./ --output ./base/manifests.yaml
- name: Setup Goenv
uses: ./consul-api-gateway/.github/actions/goenv
with:
go-version: ${{ env.GO_VERSION }}
- name: Run tests
working-directory: "gateway-api/conformance"
run: go test -v -timeout 10m ./ --gateway-class=consul-api-gateway
- name: Report status
if: always() && github.ref == 'refs/heads/main'
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
env:
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
with:
payload: |
{
"Message": "conformance/${{ matrix.cluster-type }} - ${{ matrix.config.name }} ${{ job.status }}",
"Repository": "<https://hashicorp/consul-api-gateway|hashicorp/consul-api-gateway>",
"Commit": "${{ github.sha }}",
}
- name: Tear down EKS cluster
if: always() && matrix.cluster-type == 'eks'
uses: ./consul-api-gateway/.github/actions/teardown-eks
with:
cluster_name: ${{ steps.unique.outputs.clustername }}