From fe3d5aa37918c6280a99723b3df1d7a1ff94e47a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 13 Nov 2024 20:50:40 +0000 Subject: [PATCH 1/2] consolidate actions --- .github/workflows/actions.yml | 39 ------------------------- .github/workflows/common-workflows.yaml | 17 +++++++++++ .github/workflows/go-version.yaml | 2 +- .github/workflows/linters.yaml | 31 -------------------- .github/workflows/release.yaml | 7 ++--- .golangci.yaml | 34 --------------------- 6 files changed, 21 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/actions.yml create mode 100644 .github/workflows/common-workflows.yaml delete mode 100644 .github/workflows/linters.yaml delete mode 100644 .golangci.yaml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index 813c993..0000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Workflow -on: - push: - branches: [main] - pull_request: - branches: [main] - workflow_dispatch: -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: ./... - 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..05e4e07 --- /dev/null +++ b/.github/workflows/common-workflows.yaml @@ -0,0 +1,17 @@ +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 + + common: + 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 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/linters.yaml b/.github/workflows/linters.yaml deleted file mode 100644 index 29c43fc..0000000 --- a/.github/workflows/linters.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: linters - -on: - push: - branches: [main] - pull_request: - branches: ["**"] - workflow_dispatch: - -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 b149882..dd181b3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,14 +1,13 @@ name: Release GoScaleIO # Invocable as a reusable workflow # Can be manually triggered -on: - workflow_call: +on: # yamllint disable-line rule:truthy + workflow_call: 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 diff --git a/.golangci.yaml b/.golangci.yaml deleted file mode 100644 index 741c050..0000000 --- a/.golangci.yaml +++ /dev/null @@ -1,34 +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 -linters-settings: - gosec: - excludes: - - G402 # Look for bad TLS connection settings From ffb7c1f78350d73475ef8e80b15cb788f2e269be Mon Sep 17 00:00:00 2001 From: root Date: Wed, 13 Nov 2024 20:53:11 +0000 Subject: [PATCH 2/2] fix lint --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9f9f43f..b3e8589 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,4 @@ os: - linux install: true -script: go build +script: go build