-
Notifications
You must be signed in to change notification settings - Fork 1k
97 lines (94 loc) · 3.03 KB
/
go-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
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
name: Go Test
on:
push:
paths:
- 'test/datadog-operator/**'
- 'charts/datadog-operator/**'
pull_request:
paths:
- 'test/datadog-operator/**'
- 'charts/datadog-operator/**'
# Permission forced by repo-level setting; only elevate on job-level
permissions:
contents: read
# packages: read
env:
GO111MODULE: "on"
PROJECTNAME: "helm-charts"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f # v1.1.3
with:
go-version: 1.21
id: go
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: v3.14.0
- name: Add Datadog Helm repo
run: helm repo add datadog https://helm.datadoghq.com && helm repo update
- name: Check out code into the Go module directory
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: run Go tests
run: |
helm dependency build ./charts/datadog-operator
make unit-test-operator
integ-tests:
if: ${{github.event.pull_request.head.repo.full_name == github.repository }}
name: integ-tests
runs-on: ubuntu-20.04
strategy:
matrix:
versions:
- k8s: v1.16.15
kind: v0.15.0
- k8s: v1.18.20
kind: v0.17.0
- k8s: v1.22.17
kind: v0.22.0
- k8s: v1.24.17
kind: v0.22.0
- k8s: v1.25.16
kind: v0.22.0
- k8s: v1.26.15
kind: v0.22.0
- k8s: v1.27.16
kind: v0.22.0
- k8s: v1.28.13
kind: v0.22.0
- k8s: v1.29.8
kind: v0.22.0
- k8s: v1.30.4
kind: v0.22.0
- k8s: v1.31.1
kind: v0.22.0
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Create K8s ${{ matrix.versions.k8s }} cluster with kind version ${{ matrix.versions.kind }}
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
version: ${{ matrix.versions.kind }}
node_image: kindest/node:${{ matrix.versions.k8s }}
cluster_name: operator-ci-${{ matrix.versions.k8s }}
config: .github/kind_config.yaml
- name: Add Cert Manager Helm repo
run: helm repo add jetstack https://charts.jetstack.io && helm repo update
- name: Add Datadog Helm repo
run: helm repo add datadog https://helm.datadoghq.com && helm repo update
- name: Run integ tests
env:
API_KEY: ${{ secrets.GO_INTEG_TEST_API_KEY }}
APP_KEY: ${{ secrets.GO_INTEG_TEST_APP_KEY }}
CLUSTER_NAME: operator-ci-${{ matrix.versions.k8s }}
K8S_VERSION: ${{ matrix.versions.k8s }}
run: |
kubectl cluster-info
kubectl get nodes
helm dependency build ./charts/datadog-operator
make integration-test