-
-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (54 loc) · 1.68 KB
/
kubernetes-integration-test.yaml
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
name: kubernetes-integration-test
on: [pull_request, push]
jobs:
kubernetes-integration-test:
env:
TEST_PLATFORM: kubernetes
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v5
-
name: Go build
run: CGO_ENABLED=0 GOOS=linux go build -o grid-intensity .
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Docker build
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: thegreenwebfoundation/grid-intensity:integration-test
-
name: Create kubernetes Kind Cluster
uses: helm/kind-action@v1.5.0
-
name: Load image into Kind cluster
run: kind load docker-image --name chart-testing thegreenwebfoundation/grid-intensity:integration-test
-
name: Set up Helm
uses: azure/setup-helm@v3
-
name: Helm install
run: helm install grid-intensity-exporter helm/grid-intensity-exporter --set image.tag=integration-test
-
name: Set up Kubectl
uses: azure/setup-kubectl@v3
-
name: Wait for ready pod
run: kubectl wait --for=condition=ready -l app.kubernetes.io/name=grid-intensity-exporter pod
-
name: Create port forward to metrics port
run: kubectl port-forward deployment/grid-intensity-exporter 8000:8000 &
-
name: Run integration test
run: go test -v -tags=dockerrequired ./integration/test/exporter