-
Notifications
You must be signed in to change notification settings - Fork 26
ci: add pre-main workflow for tests and linting #246
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
Open
sebrandon1
wants to merge
1
commit into
openshift:main
Choose a base branch
from
sebrandon1:add_workflows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Test Incoming Changes | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
|
|
||
| - name: Run golangci-lint | ||
| uses: golangci/golangci-lint-action@v9 | ||
| with: | ||
| version: latest | ||
| args: --timeout=5m | ||
|
|
||
| - name: Install shfmt | ||
| uses: mfinelli/setup-shfmt@v3 | ||
|
|
||
| - name: Run shfmt | ||
| run: shfmt -d -i 4 -ci hack/ | ||
|
|
||
| test: | ||
| name: Run Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: go.mod | ||
| cache: true | ||
|
|
||
| - name: Run tests | ||
| run: make test | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,135 +1,117 @@ | ||
| --- | ||
| new: true | ||
| new-from-rev: 722af08 | ||
| version: "2" | ||
| run: | ||
| concurrency: 6 | ||
| timeout: 5m | ||
| linters: | ||
| disable-all: true | ||
| default: none | ||
| enable: | ||
| - depguard | ||
| - errorlint | ||
| - goconst | ||
| - gocritic | ||
| - revive | ||
| - gofmt | ||
| - goimports | ||
| - gocyclo | ||
| - gosec | ||
| - govet | ||
| - ineffassign | ||
| - loggercheck | ||
| - misspell | ||
| - revive | ||
| - staticcheck | ||
| - typecheck | ||
| - unconvert | ||
| - unparam | ||
| - gocyclo | ||
| - unused | ||
| - errorlint | ||
| - loggercheck | ||
| - gosec | ||
| - wrapcheck | ||
| linters-settings: | ||
| revive: | ||
| rules: | ||
| - name: if-return | ||
| severity: warning | ||
| disabled: true | ||
| - name: string-format | ||
| severity: warning | ||
| disabled: false | ||
| arguments: | ||
| - - 'core.WriteError[1].Message' | ||
| - '/^([^A-Z]|$)/' | ||
| - must not start with a capital letter | ||
| - - 'fmt.Errorf[0]' | ||
| - '/^([^A-Z]|$)/' | ||
| - must not start with a capital letter | ||
| - - 'fmt.Errorf[0]' | ||
| - '/(^|[^\.!?])$/' | ||
| - must not end in punctuation | ||
| - - panic | ||
| - '/^[^\n]*$/' | ||
| - must not contain line breaks | ||
| gocritic: | ||
| enabled-checks: | ||
| # Diagnostic | ||
| - commentedOutCode | ||
| - nilValReturn | ||
| - weakCond | ||
| - octalLiteral | ||
| - sloppyReassign | ||
|
|
||
| # Performance | ||
| - equalFold | ||
| - indexAlloc | ||
| - rangeExprCopy | ||
| - appendCombine | ||
|
|
||
| # Style | ||
| - boolExprSimplify | ||
| - commentedOutImport | ||
| - docStub | ||
| - emptyFallthrough | ||
| - emptyStringTest | ||
| - hexLiteral | ||
| - methodExprCall | ||
| - stringXbytes | ||
| - typeAssertChain | ||
| - unlabelStmt | ||
| - yodaStyleExpr | ||
|
|
||
| # Opinionated | ||
| - initClause | ||
| - nestingReduce | ||
| - ptrToRefParam | ||
| - typeUnparen | ||
| - unnecessaryBlock | ||
| - paramTypeCombine | ||
| depguard: | ||
| # Rules to apply. | ||
| # | ||
| # Variables: | ||
| # - File Variables | ||
| # you can still use and exclamation mark ! in front of a variable to say not to use it. | ||
| # Example !$test will match any file that is not a go test file. | ||
| # | ||
| # `$all` - matches all go files | ||
| # `$test` - matches all go test files | ||
| # | ||
| # - Package Variables | ||
| # | ||
| # `$gostd` - matches all of go's standard library (Pulled from `GOROOT`) | ||
| # | ||
| # Default: Only allow $gostd in all files. | ||
| rules: | ||
| # Name of a rule. | ||
| main: | ||
| # Used to determine the package matching priority. | ||
| # There are three different modes: `original`, `strict`, and `lax`. | ||
| # Default: "original" | ||
| list-mode: lax | ||
| # List of file globs that will match this list of settings to compare against. | ||
| # Default: $all | ||
| files: | ||
| - $all | ||
| # List of allowed packages. | ||
| # allow: | ||
| # - $gostd | ||
| # Packages that are not allowed where the value is a suggestion. | ||
| deny: | ||
| - pkg: "github.com/pkg/errors" | ||
| desc: Should be replaced by standard lib errors package | ||
| wrapcheck: | ||
| ignoreSigs: | ||
| # defaults | ||
| - .Errorf( | ||
| - errors.New( | ||
| - errors.Unwrap( | ||
| - errors.Join( | ||
| - .Wrap( | ||
| - .Wrapf( | ||
| - .WithMessage( | ||
| - .WithMessagef( | ||
| - .WithStack( | ||
| # from kyaml's errors package | ||
| - .WrapPrefixf( | ||
| # from kcmdutil | ||
| - .UsageErrorf( | ||
| settings: | ||
| depguard: | ||
| rules: | ||
| main: | ||
| list-mode: lax | ||
| files: | ||
| - $all | ||
| deny: | ||
| - pkg: github.com/pkg/errors | ||
| desc: Should be replaced by standard lib errors package | ||
| gocritic: | ||
| enabled-checks: | ||
| - commentedOutCode | ||
| - nilValReturn | ||
| - weakCond | ||
| - octalLiteral | ||
| - sloppyReassign | ||
| - equalFold | ||
| - indexAlloc | ||
| - rangeExprCopy | ||
| - appendCombine | ||
| - boolExprSimplify | ||
| - commentedOutImport | ||
| - docStub | ||
| - emptyFallthrough | ||
| - emptyStringTest | ||
| - hexLiteral | ||
| - methodExprCall | ||
| - stringXbytes | ||
| - typeAssertChain | ||
| - unlabelStmt | ||
| - yodaStyleExpr | ||
| - initClause | ||
| - nestingReduce | ||
| - ptrToRefParam | ||
| - typeUnparen | ||
| - unnecessaryBlock | ||
| - paramTypeCombine | ||
| revive: | ||
| rules: | ||
| - name: if-return | ||
| severity: warning | ||
| disabled: true | ||
| - name: string-format | ||
| arguments: | ||
| - - core.WriteError[1].Message | ||
| - /^([^A-Z]|$)/ | ||
| - must not start with a capital letter | ||
| - - fmt.Errorf[0] | ||
| - /^([^A-Z]|$)/ | ||
| - must not start with a capital letter | ||
| - - fmt.Errorf[0] | ||
| - /(^|[^\.!?])$/ | ||
| - must not end in punctuation | ||
| - - panic | ||
| - /^[^\n]*$/ | ||
| - must not contain line breaks | ||
| severity: warning | ||
| disabled: false | ||
| wrapcheck: | ||
| ignore-sigs: | ||
| - .Errorf( | ||
| - errors.New( | ||
| - errors.Unwrap( | ||
| - errors.Join( | ||
| - .Wrap( | ||
| - .Wrapf( | ||
| - .WithMessage( | ||
| - .WithMessagef( | ||
| - .WithStack( | ||
| - .WrapPrefixf( | ||
| - .UsageErrorf( | ||
| exclusions: | ||
| generated: lax | ||
| presets: | ||
| - comments | ||
| - common-false-positives | ||
| - legacy | ||
| - std-error-handling | ||
| paths: | ||
| - vendor$ | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
| exclusions: | ||
| generated: lax | ||
| paths: | ||
| - vendor$ | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.