From 405e773ec6595b29b04a0dcc0fe074e48636a30b Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Fri, 8 Nov 2024 14:11:18 +0530 Subject: [PATCH 1/3] Updated the common workflow actions Signed-off-by: meghana_gm --- .github/workflows/actions.yml | 29 ------------------------- .github/workflows/common-workflows.yaml | 18 +++++++++++++++ .github/workflows/go-version.yaml | 2 +- .github/workflows/release.yaml | 2 +- 4 files changed, 20 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/actions.yml create mode 100644 .github/workflows/common-workflows.yaml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index 553ccd8..0000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Workflow -on: - push: - branches: [main] - pull_request: - branches: [main] -jobs: - go_security_scan: - name: Go security - runs-on: ubuntu-latest - steps: - - name: Checkout the code - uses: actions/checkout@v4 - - name: Run Go Security - uses: securego/gosec@master - with: - # added additional exclude arguments after gosec v2.9.4 came out - args: -exclude=G101,G402 ./... - malware_security_scan: - name: Malware Scanner - runs-on: ubuntu-latest - steps: - - name: Checkout the code - uses: actions/checkout@v4 - - name: Run malware scan - uses: dell/common-github-actions/malware-scanner@main - with: - directories: . - options: -ri diff --git a/.github/workflows/common-workflows.yaml b/.github/workflows/common-workflows.yaml new file mode 100644 index 0000000..9c9ba9d --- /dev/null +++ b/.github/workflows/common-workflows.yaml @@ -0,0 +1,18 @@ +name: Common Workflows +on: # yamllint disable-line rule:truthy + push: + branches: [main] + pull_request: + branches: ["**"] + +jobs: + + # golang static analysis checks + go-static-analysis: + uses: dell/common-github-actions/.github/workflows/go-static-analysis.yaml@main + name: Golang Validation + + # checks unit tests, package coverage, and gosec + common: + name: Run gosec, unit tests, and check package coverage + uses: dell/common-github-actions/.github/workflows/go-common.yml@main diff --git a/.github/workflows/go-version.yaml b/.github/workflows/go-version.yaml index 1ba387e..20a4366 100644 --- a/.github/workflows/go-version.yaml +++ b/.github/workflows/go-version.yaml @@ -9,7 +9,7 @@ # Reusable workflow to perform go version update on Golang based projects name: Go Version Update -on: +on: # yamllint disable-line rule:truthy workflow_dispatch: repository_dispatch: types: [go-update-workflow] diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6a6aff2..a5c5330 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,7 +2,7 @@ name: Release GoPowerscale # Invocable as a reusable workflow # Can be manually triggered on: - workflow_call: + workflow_call: workflow_dispatch: inputs: version: From b590fd2d36cb33b834dff47c705832001ee9c138 Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Fri, 8 Nov 2024 15:33:01 +0530 Subject: [PATCH 2/3] Updated the common workflow actions Signed-off-by: meghana_gm --- .github/workflows/release.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a5c5330..0c0e177 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,9 +6,8 @@ on: workflow_dispatch: inputs: version: - description: 'Version to release (major, minor, patch)' + description: 'Version to release (major, minor, patch) Ex: 1.0.0' required: true - default: 'none' jobs: csm-release: uses: dell/common-github-actions/.github/workflows/csm-release-libs.yaml@main From 3ce67cdaef148839b604bd6826c1a0c6f819123e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 13 Nov 2024 20:34:28 +0000 Subject: [PATCH 3/3] consolidate actions --- .github/workflows/common-workflows.yaml | 3 +- .github/workflows/go-version.yaml | 2 +- .github/workflows/linters.yaml | 30 -------------------- .github/workflows/release.yaml | 2 +- .golangci.yaml | 37 ------------------------- 5 files changed, 3 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/linters.yaml delete mode 100644 .golangci.yaml diff --git a/.github/workflows/common-workflows.yaml b/.github/workflows/common-workflows.yaml index 9c9ba9d..05e4e07 100644 --- a/.github/workflows/common-workflows.yaml +++ b/.github/workflows/common-workflows.yaml @@ -12,7 +12,6 @@ jobs: uses: dell/common-github-actions/.github/workflows/go-static-analysis.yaml@main name: Golang Validation - # checks unit tests, package coverage, and gosec common: - name: Run gosec, unit tests, and check package coverage + name: Quality Checks uses: dell/common-github-actions/.github/workflows/go-common.yml@main diff --git a/.github/workflows/go-version.yaml b/.github/workflows/go-version.yaml index 20a4366..51df53b 100644 --- a/.github/workflows/go-version.yaml +++ b/.github/workflows/go-version.yaml @@ -9,7 +9,7 @@ # Reusable workflow to perform go version update on Golang based projects name: Go Version Update -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy workflow_dispatch: repository_dispatch: types: [go-update-workflow] diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml deleted file mode 100644 index 16b9903..0000000 --- a/.github/workflows/linters.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: linters - -on: - push: - branches: [main] - pull_request: - branches: ["**"] - -permissions: - contents: read - -jobs: - golangci-lint: - name: golangci-lint - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v5 - with: - go-version: "1.23" - cache: false - - name: Checkout the code - uses: actions/checkout@v4 - - name: Vendor packages - run: | - go mod vendor - - name: golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - version: latest - skip-cache: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0c0e177..91ed55e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,7 +1,7 @@ name: Release GoPowerscale # Invocable as a reusable workflow # Can be manually triggered -on: +on: # yamllint disable-line rule:truthy workflow_call: workflow_dispatch: inputs: diff --git a/.golangci.yaml b/.golangci.yaml deleted file mode 100644 index 77f8319..0000000 --- a/.golangci.yaml +++ /dev/null @@ -1,37 +0,0 @@ -run: - timeout: 20m - tests: true - modules-download-mode: readonly - -issues: - max-issues-per-linter: 0 - max-same-issues: 0 - new: false - exclude: - - "error-naming: error var invalidFileMode should have name of the form errFoo" - - "var-naming: struct field" - - "var-naming: don't use underscores in Go names" - - "var-naming: func parameter" - - "var-naming: don't use ALL_CAPS in Go names; use CamelCase" - - "var-naming: method parameter" - - "var-naming: type" - - "unexported-return: exported func" - -output: - print-linter-name: true - sort-results: true - uniq-by-line: false - print-issued-lines: true - -linters: - disable-all: true - fast: false - enable: - # A stricter replacement for gofmt. - - gofumpt - # Inspects source code for security problems. - - gosec - # Check for correctness of programs. - - govet - # Drop-in replacement of golint. - - revive