From 43d28be5d1532713dda8570f9beb2c13627d3dd5 Mon Sep 17 00:00:00 2001 From: Grygoriy Ensary Date: Thu, 21 Mar 2024 17:14:17 -0500 Subject: [PATCH 1/2] switch to compose v2 plugin, v1 is dead --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 15dd35d..988b710 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ TAG := $(shell git rev-parse --short HEAD) DIR := $(shell pwd -L) -SDCLI_VERSION :=v1.4.0 +SDCLI_VERSION :=v1.5 SDCLI=docker run --rm -v "$(DIR):$(DIR)" -w "$(DIR)" asecurityteam/sdcli:$(SDCLI_VERSION) @@ -16,7 +16,7 @@ test: integration: DIR=$(DIR) \ PROJECT_PATH=/go/src/$(PROJECT_PATH) \ - docker-compose \ + docker compose \ -f docker-compose.it.yml \ up \ --abort-on-container-exit \ From 8eea71ce167237c22259becf07285880da7817d0 Mon Sep 17 00:00:00 2001 From: Grygoriy Ensary Date: Thu, 21 Mar 2024 17:16:19 -0500 Subject: [PATCH 2/2] Drop Travis, Enable GitHub Actions --- .github/workflows/golang.yaml | 27 +++++++ .golangci.yaml | 138 ---------------------------------- .travis.yml | 15 ---- 3 files changed, 27 insertions(+), 153 deletions(-) create mode 100644 .github/workflows/golang.yaml delete mode 100644 .golangci.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/golang.yaml b/.github/workflows/golang.yaml new file mode 100644 index 0000000..1b67afc --- /dev/null +++ b/.github/workflows/golang.yaml @@ -0,0 +1,27 @@ +on: [push] + +jobs: + golang: + runs-on: ubuntu-latest # we execute everything except make in docker anyway + name: GoLang Basics + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: FS Permissions + # workaround for permissions with contaner attempting to create directories + run: chmod 777 -R "$(pwd)" + - name: Dep + run: make dep + - name: Lint + run: make lint + - name: Unit Tests + run: make test + - name: Integration Tests + run: make integration + - name: Test Coverage + run: make coverage + - name: Upload Coverage + uses: codecov/codecov-action@v4 + with: + files: .coverage/combined.cover.out + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.golangci.yaml b/.golangci.yaml deleted file mode 100644 index 2acb648..0000000 --- a/.golangci.yaml +++ /dev/null @@ -1,138 +0,0 @@ -run: - deadline: 3m - issues-exit-code: 1 - tests: true - skip-dirs: - - .coverage - build-tags: - - integration -output: - format: colored-line-number - print-issued-lines: true - print-linter-name: true -linters-settings: - errcheck: - # report about not checking of errors in type assetions: `a := b.(MyStruct)`; - # default is false: such cases aren't reported by default. - check-type-assertions: false - - # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; - # default is false: such cases aren't reported by default. - check-blank: false - govet: - # report about shadowed variables - check-shadowing: true - golint: - # minimal confidence for issues, default is 0.8 - min-confidence: 0.8 - gofmt: - # simplify code: gofmt with `-s` option, true by default - simplify: false - gocyclo: - # minimal code complexity to report, 30 by default (but we recommend 10-20) - min-complexity: 30 - dupl: - # tokens count to trigger issue, 150 by default - threshold: 150 - goconst: - # minimal length of string constant, 3 by default - min-len: 3 - # minimal occurrences count to trigger, 3 by default - min-occurrences: 3 - depguard: - list-type: blacklist - include-go-root: false - packages: - - github.com/davecgh/go-spew/spew - misspell: - # Correct spellings using locale preferences for US or UK. - # Default is to use a neutral variety of English. - # Setting locale to US will correct the British spelling of 'colour' to 'color'. - locale: US - lll: - # max line length, lines longer will be reported. Default is 120. - # '\t' is counted as 1 character by default, and can be changed with the tab-width option - line-length: 120 - # tab width in spaces. Default to 1. - tab-width: 1 - unused: - # treat code as a program (not a library) and report unused exported identifiers; default is false. - # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: - # if it's called for subdir of a project it can't find funcs usages. All text editor integrations - # with golangci-lint call it on a directory with the changed file. - check-exported: false - unparam: - # Inspect exported functions, default is false. Set to true if no external program/library imports your code. - # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: - # if it's called for subdir of a project it can't find external interfaces. All text editor integrations - # with golangci-lint call it on a directory with the changed file. - check-exported: false - nakedret: - # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 - max-func-lines: 30 - prealloc: - # XXX: we don't recommend using this linter before doing performance profiling. - # For most programs usage of prealloc will be a premature optimization. - - # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. - # True by default. - simple: true - range-loops: true # Report preallocation suggestions on range loops, true by default - for-loops: true # Report preallocation suggestions on for loops, false by default -linters: - disable-all: true - enable: - - govet - - errcheck - - staticcheck - - unused - - gosimple - - structcheck - - varcheck - - ineffassign - - deadcode - - golint - - gosec - - unconvert - - goconst - - gocyclo - - gofmt - - goimports - - depguard - - misspell - - unparam - - nakedret - - prealloc - - gochecknoinits -issues: - exclude-use-default: false - exclude: - # errcheck: Almost all programs ignore errors on these functions and in most cases it's ok - - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked - - # golint: False positive when tests are defined in package 'test' - - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this - - # govet: Common false positives - - (possible misuse of unsafe.Pointer|should have signature) - - # megacheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore - - ineffective break statement. Did you mean to break out of the outer loop - - # gas: Too many false-positives on 'unsafe' usage - - Use of unsafe calls should be audited - - # gas: Too many false-positives for parametrized shell calls - - Subprocess launch(ed with variable|ing should be audited) - - # gas: Duplicated errcheck checks - - G104 - - # gas: Too many issues in popular repos - - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less) - - # gas: False positive is triggered by 'src, err := ioutil.ReadFile(filename)' - - Potential file inclusion via variable - - max-per-linter: 50 - max-same: 3 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0a4cf65..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go -sudo: false -go: -- 1.19.x -services: - - docker -install: - - chmod 777 -R "$(pwd)" - - make dep -script: - - make lint - - make test - - make integration - - make coverage - - bash <(curl -s https://codecov.io/bash) -f .coverage/combined.cover.out