Skip to content

Commit

Permalink
Merge pull request #1 from zeeke/pullbot
Browse files Browse the repository at this point in the history
Pullbot
  • Loading branch information
zeeke authored Dec 21, 2023
2 parents a8f01b0 + 599aaf8 commit 0475f94
Show file tree
Hide file tree
Showing 6,162 changed files with 775,021 additions and 194,205 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-8-release-golang-1.17-openshift-4.10
tag: rhel-9-release-golang-1.20-openshift-4.15
5 changes: 5 additions & 0 deletions .github/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: "1"
rules: # Array of rules
- base: master # Required. Target branch
upstream: k8snetworkplumbingwg:master # Required. Must be in the same fork network.
mergeMethod: merge # Optional, one of [none, merge, squash, rebase, hardreset], Default: none.
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "48 5 * * 6"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ go ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
44 changes: 0 additions & 44 deletions .github/workflows/go.yml

This file was deleted.

162 changes: 162 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Test SR-IOV Operator

on: [push, pull_request]

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:

build:
name: build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: fmt
run: IS_CONTAINER=yes make fmt

- name: Build
run: make all

test:
name: test
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.20.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: test pkg
run: make test-pkg

- name: test controllers on opensfhit
run: CLUSTER_TYPE=openshift make test-controllers

- name: test bindata/scripts
run: make test-bindata-scripts

golangci:
name: Golangci-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.20.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
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.51.0

test-coverage:
name: test-coverage
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: 1.20.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: test pkg
run: make test-pkg

- name: test controllers on opensfhit
run: CLUSTER_TYPE=openshift make test-controllers

- name: merge test coverage
run: make merge-test-coverage

- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.out

virtual-k8s-cluster:
name: k8s
needs: [
build,
test,
golangci,
]
runs-on: [ sriov ]
env:
TEST_REPORT_PATH: k8s-artifacts
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: run test
run: make test-e2e-conformance-virtual-k8s-cluster-ci

- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ env.TEST_REPORT_PATH }}
path: ./${{ env.TEST_REPORT_PATH }}

- name: remove virtual cluster
if: always()
run: |
kcli delete cluster $CLUSTER_NAME -y
kcli delete network $CLUSTER_NAME -y
virtual-ocp:
name: ocp
needs: [
build,
test,
golangci,
]
runs-on: [ ocp ]
env:
TEST_REPORT_PATH: ocp-artifacts
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: run test
run: make test-e2e-conformance-virtual-ocp-cluster-ci

- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ env.TEST_REPORT_PATH }}
path: ./${{ env.TEST_REPORT_PATH }}

- name: remove virtual cluster
if: always()
run: |
kcli delete cluster $CLUSTER_NAME -y
kcli delete network $CLUSTER_NAME -y
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ bin/
testbin/
env
.env
.cache
# Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
### Emacs ###
# -*- mode: gitignore; -*-
Expand Down
121 changes: 121 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Tested with golangci-lint ver. 1.37
run:
timeout: 10m
skip-dirs:
- vendor/
- .github/
- deployment/
- doc/
- bindata/
- pkg/client
linters-settings:
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
dupl:
threshold: 100
funlen:
lines: 100
statements: 50
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
- unnamedResult
settings:
hugeParam:
sizeThreshold: 512
rangeValCopy:
sizeThreshold: 512
gocyclo:
min-complexity: 15
goimports:
local-prefixes: github.com/k8snetworkplumbingwg/sriov-network-operator
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
lll:
line-length: 140
misspell:
locale: US
prealloc:
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
# True by default.
simple: true
range-loops: true # Report preallocation suggestions on range loops, true by default
for-loops: false # Report preallocation suggestions on for loops, false by default
stylecheck:
dot-import-whitelist:
- github.com/onsi/ginkgo/v2
- github.com/onsi/gomega
- github.com/onsi/gomega/gstruct

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- depguard
- dogsled
# TODO fix issues- dupl
# TODO fix issues- errcheck
- exportloopref
- exhaustive
# TODO fix issues- funlen
#- gochecknoinits
- goconst
# TODO fix issues- gocritic
# TODO fix issues- gocyclo
- gofmt
- goimports
# TODO fix issues- gomnd
- goprintffuncname
# TODO fix issues- gosec
- gosimple
#- govet
- ineffassign
# TODO fix issues- lll
- misspell
# TODO fix issues- nakedret
# TODO fix issues- prealloc
#- scopelint
# TODO fix issues- staticcheck
- stylecheck
- typecheck
- unconvert
# TODO fix issues- unparam
- unused
- whitespace

issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gomnd
- gosec
- dupl
- lll
- stylecheck
- goconst

Loading

0 comments on commit 0475f94

Please sign in to comment.