Skip to content

Commit

Permalink
[IGNORE] enable ci
Browse files Browse the repository at this point in the history
Signed-off-by: Augustin Husson <[email protected]>
  • Loading branch information
Nexucis committed Nov 14, 2023
1 parent ec97e0a commit 4a99bd3
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
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

0 comments on commit 4a99bd3

Please sign in to comment.