Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IGNORE] enable ci #6

Merged
merged 1 commit into from
Nov 14, 2023
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: ci
on:
push:
branches:
- main
- release/*
- snapshot/*
tags:
- v*
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.ref_name != 'main' }}

jobs:
build:
name: "go and github release"
runs-on: ubuntu-latest
permissions:
contents: write
env:
# This env is required for the docker manifest command to work
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: perses/[email protected]
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
- name: Build operator
run: make build
60 changes: 60 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: go
on:
push:
branches:
- main
- release/*
- snapshot/*
tags:
- v*
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.ref_name != 'main' }}

jobs:
gofmt:
name: "check code format"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: perses/[email protected]
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
- name: check format
run: make checkformat
- name: check go.mod
run: make checkunused
test:
name: "tests"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: perses/[email protected]
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
- name: test
run: make test
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: perses/[email protected]
- uses: ./.github/perses-ci/actions/setup_environment
with:
enable_go: true
- name: generate files
run: make generate
- name: golangci-lint
uses: golangci/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.54.2
args: --timeout 5m
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ all: build
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)


.PHONY: checkformat
checkformat:
@echo ">> checking go code format"
! gofmt -d $$(find . -name '*.go' -not -path "./ui/*" -print) | grep '^'

.PHONY: checkunused
checkunused:
@echo ">> running check for unused/missing packages in go.mod"
go mod tidy
@git diff --exit-code -- go.sum go.mod

##@ Development

.PHONY: manifests
Expand Down
Loading