Skip to content

ci: Ensure all generated code is committed (#1570) #2381

ci: Ensure all generated code is committed (#1570)

ci: Ensure all generated code is committed (#1570) #2381

Workflow file for this run

name: Main CI WorkFlow
on:
push:
branches:
- 'master'
- 'release-*'
tags:
- 'v*'
paths:
- ".github/workflows/main.yaml"
- ".github/workflows/build-op-image.yaml"
- "apis/**"
- "cmd/**"
- "controllers/**"
- "hack/**"
- "manifests/setup/setup.yaml"
- "tests/**"
- "pkg/**"
- "**/*.sh"
- "Makefile"
- "go.mod"
- "go.sum"
pull_request:
branches:
- 'master'
- 'release-*'
paths:
- ".github/workflows/main.yaml"
- ".github/workflows/build-op-image.yaml"
- "apis/**"
- "cmd/**"
- "controllers/**"
- "hack/**"
- "manifests/setup/setup.yaml"
- "tests/**"
- "pkg/**"
- "**/*.sh"
- "Makefile"
- "go.mod"
- "go.sum"
env:
KUBECTL_VERSION: v1.25.1
HELM_VERSION: v3.17.2
jobs:
basic_tests:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Basic test and verify
env:
GO111MODULE: "on"
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Ensure all generated code is committed
run: |
make generate manifests docs-update
git diff --exit-code
- name: Check shell scripts
run: make shellcheck
- name: Go mod
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go mod download
- name: Install kubebuilder
run: |
curl -L -o kubebuilder "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.9.0/kubebuilder_linux_amd64"
chmod +x kubebuilder && mv kubebuilder /usr/local/bin/
- name: Run basic test
run: make test
- name: Run verify crds test
run: make verify
e2e_tests:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: e2e tests
env:
GO111MODULE: "on"
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Setup kubectl
uses: marcofranssen/setup-kubectl@d81bf181729cee2bc813ac2ea2f74dec90f01f99 # v1.3.0
with:
kubectlVersion: ${{ env.KUBECTL_VERSION }}
- name: Install dependences
run: make ginkgo kind
- name: Run e2e tests
run: make e2e
helm_tests:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: helm e2e tests
env:
GO111MODULE: "on"
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Setup kubectl
uses: marcofranssen/setup-kubectl@d81bf181729cee2bc813ac2ea2f74dec90f01f99 # v1.3.0
with:
kubectlVersion: ${{ env.KUBECTL_VERSION }}
- name: Install Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
with:
version: ${{ env.HELM_VERSION }}
- name: Install dependences
run: make ginkgo kind
- name: Run helm e2e tests
run: make helm-e2e
build:
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Binary build
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Run build all binaries
run: make binary
# docker-build:
# runs-on: ubuntu-22.04
# timeout-minutes: 30
# name: Docker amd64 build
# steps:
# - name: Checkout code
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# fetch-depth: 0
# - name: Install Go
# uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
# with:
# go-version-file: go.mod
# cache-dependency-path: go.sum
# - name: Run docker build
# run: make build-amd64