From 2da74717a2ebb08071cc9e9f15e7ecc7b963dd79 Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Fri, 8 Nov 2024 13:15:13 +0530 Subject: [PATCH 1/5] updated the common workflow actions Signed-off-by: meghana_gm --- .github/workflows/actions.yml | 38 ------------------------- .github/workflows/common-workflows.yaml | 18 ++++++++++++ .github/workflows/go-version.yaml | 2 +- 3 files changed, 19 insertions(+), 39 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 93082d5..0000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Workflow -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - code-check: - name: Check Go formatting, linting, vetting - runs-on: ubuntu-latest - steps: - - name: Checkout the code - uses: actions/checkout@v4 - - name: Run the formatter, linter, and vetter - uses: dell/common-github-actions/go-code-formatter-linter-vetter@main - with: - directories: ./... - 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: - args: --exclude=G204 ./... - 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..f8c6329 --- /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 \ No newline at end of file diff --git a/.github/workflows/go-version.yaml b/.github/workflows/go-version.yaml index 1ba387e..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: +on: # yamllint disable-line rule:truthy workflow_dispatch: repository_dispatch: types: [go-update-workflow] From 077d20269461517138af39dcb22f73e82b25c3fc Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Fri, 8 Nov 2024 13:27:00 +0530 Subject: [PATCH 2/5] updated the common workflow actions Signed-off-by: meghana_gm --- .github/workflows/common-workflows.yaml | 2 +- .github/workflows/go-version.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/common-workflows.yaml b/.github/workflows/common-workflows.yaml index f8c6329..9c9ba9d 100644 --- a/.github/workflows/common-workflows.yaml +++ b/.github/workflows/common-workflows.yaml @@ -15,4 +15,4 @@ jobs: # 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 \ No newline at end of file + 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 51df53b..1ba387e 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: workflow_dispatch: repository_dispatch: types: [go-update-workflow] From 9ffbe99a0df85d588764261198ac72a3884dcfe2 Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Fri, 8 Nov 2024 13:29:53 +0530 Subject: [PATCH 3/5] updated the common workflow actions Signed-off-by: meghana_gm --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2f9607a..b365e37 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,7 +2,7 @@ name: Release GoiSCSI # Invocable as a reusable workflow # Can be manually triggered on: - workflow_call: + workflow_call: workflow_dispatch: inputs: version: From fd628f5a3aea53000f2d6601ee18fd45444f25d0 Mon Sep 17 00:00:00 2001 From: meghana_gm Date: Fri, 8 Nov 2024 15:35:51 +0530 Subject: [PATCH 4/5] Updated the common workflow actions Signed-off-by: meghana_gm --- .github/workflows/go-version.yaml | 2 +- .github/workflows/release.yaml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-version.yaml b/.github/workflows/go-version.yaml index 1ba387e..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: +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 b365e37..4caa444 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 fadee8e1a6c7e409931a916eeca77a2811001c2f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 13 Nov 2024 20:17:31 +0000 Subject: [PATCH 5/5] consolidate checks --- .github/workflows/common-workflows.yaml | 3 +-- .github/workflows/linters.yaml | 30 ------------------------- .github/workflows/release.yaml | 2 +- .golangci.yaml | 30 ------------------------- 4 files changed, 2 insertions(+), 63 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/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 4caa444..2eef110 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,7 +1,7 @@ name: Release GoiSCSI # 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 56f5332..0000000 --- a/.golangci.yaml +++ /dev/null @@ -1,30 +0,0 @@ -run: - timeout: 20m - issue-exit-code: 0 # we will change this later - tests: true - skip-dirs-use-default: true - modules-download-mode: readonly - -issues: - max-issues-per-linter: 0 - max-same-issues: 0 - new: false - -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