-
Notifications
You must be signed in to change notification settings - Fork 49
51 lines (43 loc) · 1.49 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
check:
name: Check
runs-on: ubuntu-latest
# Execute the checks inside the container instead the VM.
container: golangci/golangci-lint:v1.54.2-alpine
steps:
- uses: actions/checkout@v3
- run: ./hack/scripts/check.sh
unit-test:
name: Unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- run: make ci-unit-test
integration-test:
name: Integration test
runs-on: ubuntu-latest
needs: [check, unit-test]
strategy:
matrix:
kubernetes: [1.24.15, 1.25.11, 1.26.6, 1.27.3, 1.28.0]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Execute tests
env:
KIND_VERSION: v0.20.0
run: |
# Get dependencies.
echo "Getting dependencies..."
curl -Lo kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64 && chmod +x kind && sudo mv kind /usr/local/bin/
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v${{ matrix.kubernetes }}/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Start cluster.
echo "Executing ${{ matrix.kubernetes }} Kubernetes tests..."
KUBERNETES_VERSION=${{ matrix.kubernetes }} make ci-integration-test