This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
133 lines (117 loc) · 5.2 KB
/
conformance.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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 }}