Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]

env:
GOFLAGS: "-mod=mod"
CONTAINER_ENGINE: docker

jobs:
# =========================
# Build + Generate + Manifests
# =========================
build:
name: Build & Generate
runs-on: ubuntu-22.04

steps:
- name: Generate code
run: make generate

- name: Build manager binary
run: make manager

- name: Generate manifests
run: make manifests

# =========================
# Unit tests
# =========================
unit-test:
name: Unit Tests
runs-on: ubuntu-22.04
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Run unit tests
run: make unit-test

# =========================
# Helm build (k8s)
# =========================
helm-build:
name: Helm Build (k8s)
runs-on: ubuntu-22.04
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y make curl

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.14.4

- name: Generate Helm charts (k8s)
run: make helm-k8s

# =========================
# Docker image build
# =========================
docker-build:
name: Docker Build
runs-on: ubuntu-22.04
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Build Docker image
run: make docker-build

10 changes: 5 additions & 5 deletions internal/controllers/network_config_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var _ = Describe("getLabelsPerModules", func() {
BeforeEach(func() {
ctrl := gomock.NewController(GinkgoT())
kubeClient = mock_client.NewMockClient(ctrl)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, nil, nil, nil, nil, nil, nil, nil, nil)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, nil, nil, nil, nil, nil, nil, nil)
})

ctx := context.Background()
Expand Down Expand Up @@ -139,7 +139,7 @@ var _ = Describe("setFinalizer", func() {
BeforeEach(func() {
ctrl := gomock.NewController(GinkgoT())
kubeClient = mock_client.NewMockClient(ctrl)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, nil, nil, nil, nil, nil, nil, nil, nil)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, nil, nil, nil, nil, nil, nil, nil)
})

ctx := context.Background()
Expand Down Expand Up @@ -175,7 +175,7 @@ var _ = PDescribe("finalizeNetworkConfig", func() {
BeforeEach(func() {
ctrl := gomock.NewController(GinkgoT())
kubeClient = mock_client.NewMockClient(ctrl)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, nil, nil, nil, nil, nil, nil, nil, nil)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, nil, nil, nil, nil, nil, nil, nil)
})

ctx := context.Background()
Expand Down Expand Up @@ -345,7 +345,7 @@ var _ = PDescribe("handleKMMModule", func() {
ctrl := gomock.NewController(GinkgoT())
kubeClient = mock_client.NewMockClient(ctrl)
kmmHelper = kmmmodule.NewMockKMMModuleAPI(ctrl)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, kmmHelper, nil, nil, nil, nil, nil, nil, nil)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, kmmHelper, nil, nil, nil, nil, nil, nil)
})

ctx := context.Background()
Expand Down Expand Up @@ -413,7 +413,7 @@ var _ = Describe("handleBuildConfigMap", func() {
ctrl := gomock.NewController(GinkgoT())
kubeClient = mock_client.NewMockClient(ctrl)
kmmHelper = kmmmodule.NewMockKMMModuleAPI(ctrl)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, kmmHelper, nil, nil, nil, nil, nil, nil, nil)
dcrh = newNetworkConfigReconcilerHelper(kubeClient, kmmHelper, nil, nil, nil, nil, nil, nil)
})

ctx := context.Background()
Expand Down
Loading