From 95112cc4501ec2303c2263a22a22ae2b935f6179 Mon Sep 17 00:00:00 2001 From: Grendgi Date: Tue, 9 Jun 2026 10:33:53 +0300 Subject: [PATCH] Add CI workflow --- .gitea/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ .golangci.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .gitea/workflows/ci.yml create mode 100644 .golangci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..bad362b --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + pull_request: + +jobs: + go: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - run: go build ./... + - run: go test ./... + - uses: golangci/golangci-lint-action@v7 + with: + version: v2.4 + args: --config .golangci.yml ./... + + python: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: python -m compileall app diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..5dda72d --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,36 @@ +version: "2" + +run: + timeout: 3m + +linters: + default: none + enable: + - errcheck + - govet + - ineffassign + - staticcheck + - unused + settings: + errcheck: + check-type-assertions: true + check-blank: false + exclude-functions: + - (io.Closer).Close + - (net/http.ResponseWriter).Write + - (*encoding/json.Encoder).Encode + - io.Copy + - fmt.Fprintf + - (github.com/jackc/pgx/v5.Tx).Rollback + - os.RemoveAll + staticcheck: + checks: ["all", "-SA1019", "-ST1000", "-ST1005", "-ST1020", "-ST1021", "-ST1022"] + exclusions: + rules: + - path: _test\.go + linters: + - errcheck + +issues: + max-issues-per-linter: 0 + max-same-issues: 0