From d0a468c440af7a6cf41b78ff6d6c24663da8e4e3 Mon Sep 17 00:00:00 2001 From: Akash LM Date: Tue, 9 Apr 2024 15:35:13 +0530 Subject: [PATCH] feat: Add ci.yaml workflow --- .ci.yml | 30 ++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 41 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .ci.yml create mode 100644 .github/workflows/ci.yaml diff --git a/.ci.yml b/.ci.yml new file mode 100644 index 00000000..7d6d2965 --- /dev/null +++ b/.ci.yml @@ -0,0 +1,30 @@ +run: + timeout: 10m + concurrency: 4 + +concurrency: 4 + +linters: + disable-all: true + enable: + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - unused + - misspell + - dupl + - stylecheck + +linters-settings: + gofmt: + simplify: true + dupl: + threshold: 400 + +issues: + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. + max-issues-per-linter: 0 + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. + max-same-issues: 0 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..9b8ea51e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,41 @@ + +name: ci +on: + push: + branches: + - "*" + - main + pull_request: + +permissions: + contents: write + security-events: write + # Optional: allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: false + - name: Run tests + run: go test ./... -coverprofile=coverage.out -coverpkg=./... -covermode=atomic + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54 + args: -v --config=.ci.yml + skip-pkg-cache: true + skip-build-cache: true + + - name: Static check + uses: dominikh/staticcheck-action@v1.3.0 + with: + version: "2023.1.6" + install-go: false + cache-key: '1.21'