-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from caliskanugur/qa-issue-1230
[Main] Add a Workflow That Verifies Changes
- Loading branch information
Showing
11 changed files
with
158 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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,13 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
oldPWD="$(pwd)" | ||
|
||
dirs=("./clients" "./extensions" "./pkg") | ||
|
||
for dir in "${dirs[@]}"; do | ||
echo "Building $dir" | ||
cd "$dir" | ||
go build ./... | ||
cd "$oldPWD" | ||
done |
This file contains 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,12 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
go mod tidy | ||
go mod verify | ||
|
||
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then | ||
echo "Go mod isn't up to date. Please run go mod tidy." | ||
echo "The following go files did differ after tidying them:" | ||
git status --porcelain | ||
exit 1 | ||
fi |
This file contains 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,45 @@ | ||
name: Verify Changes | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- 'release/*' | ||
- 'main' | ||
|
||
jobs: | ||
verify-changes: | ||
name: verify-changes | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version-file: './go.mod' | ||
|
||
- name: Go Version | ||
run: go version | ||
|
||
- name: Generate Golang | ||
run: | | ||
export PATH=$PATH:/home/runner/go/bin/ | ||
- name: Verify Go Mod | ||
run: ./.github/scripts/check-go-mod.sh | ||
|
||
- name: Build Packages | ||
run: ./.github/scripts/build-packages.sh | ||
|
||
- name: Golangci Lint | ||
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0 | ||
with: | ||
# Patch version isn't needed; https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#internals | ||
version: v1.57 | ||
# Skip cache cause: https://github.com/golangci/golangci-lint-action/issues/135 | ||
skip-cache: true |
This file contains 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,41 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- ineffassign | ||
- goimports | ||
- govet | ||
- misspell | ||
- revive | ||
- unused | ||
- goconst | ||
- forbidigo | ||
- predeclared | ||
linters-settings: | ||
revive: | ||
rules: | ||
- name: confusing-naming | ||
disabled: true | ||
- name: exported | ||
disabled: false | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 10 | ||
match-constant: true | ||
ignore-strings: "metadata.+" | ||
forbidigo: | ||
forbid: | ||
- p: ^*\.Sleep.*$ | ||
msg: "No sleeps please use the appropriate polls and watch" | ||
- p: ^fmt\.Print.*$ | ||
msg: "No format prints, please testing or logrus packages" | ||
run: | ||
tests: false | ||
timeout: 10m | ||
issues: | ||
exclude-dirs: | ||
- pkg/generated/* | ||
- clients/rancher/generated/* | ||
exclude-files: | ||
- ^*\.yaml$ | ||
- ^*\.yml$ | ||
exclude-generated-strict: true |
This file contains 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 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 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 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 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 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.