linting added to CI + bypass tags
Some checks failed
ci/woodpecker/push/fx_oracle Pipeline is pending
ci/woodpecker/push/gateway_mntx Pipeline is pending
ci/woodpecker/push/gateway_tron Pipeline is pending
ci/woodpecker/push/ledger Pipeline is pending
ci/woodpecker/push/payments_methods Pipeline is pending
ci/woodpecker/push/payments_orchestrator Pipeline is pending
ci/woodpecker/push/payments_quotation Pipeline is pending
ci/woodpecker/push/gateway_chain Pipeline is pending
ci/woodpecker/push/gateway_tgsettle Pipeline is pending
ci/woodpecker/push/notification Pipeline is pending
ci/woodpecker/push/billing_documents Pipeline failed
ci/woodpecker/push/callbacks Pipeline failed
ci/woodpecker/push/discovery Pipeline failed
ci/woodpecker/push/bff Pipeline failed
ci/woodpecker/push/frontend Pipeline failed
ci/woodpecker/push/billing_fees Pipeline failed
ci/woodpecker/push/fx_ingestor Pipeline failed
Some checks failed
ci/woodpecker/push/fx_oracle Pipeline is pending
ci/woodpecker/push/gateway_mntx Pipeline is pending
ci/woodpecker/push/gateway_tron Pipeline is pending
ci/woodpecker/push/ledger Pipeline is pending
ci/woodpecker/push/payments_methods Pipeline is pending
ci/woodpecker/push/payments_orchestrator Pipeline is pending
ci/woodpecker/push/payments_quotation Pipeline is pending
ci/woodpecker/push/gateway_chain Pipeline is pending
ci/woodpecker/push/gateway_tgsettle Pipeline is pending
ci/woodpecker/push/notification Pipeline is pending
ci/woodpecker/push/billing_documents Pipeline failed
ci/woodpecker/push/callbacks Pipeline failed
ci/woodpecker/push/discovery Pipeline failed
ci/woodpecker/push/bff Pipeline failed
ci/woodpecker/push/frontend Pipeline failed
ci/woodpecker/push/billing_fees Pipeline failed
ci/woodpecker/push/fx_ingestor Pipeline failed
This commit is contained in:
@@ -47,6 +47,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh bff
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -75,7 +85,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/bff/build-image.sh
|
||||
|
||||
|
||||
@@ -42,6 +42,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh billing_documents
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -70,7 +80,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/billing_documents/build-image.sh
|
||||
|
||||
|
||||
@@ -42,6 +42,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh billing_fees
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -70,7 +80,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/billing_fees/build-image.sh
|
||||
|
||||
|
||||
@@ -43,6 +43,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh callbacks
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -71,7 +81,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/callbacks/build-image.sh
|
||||
|
||||
|
||||
@@ -41,6 +41,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh discovery
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -69,7 +79,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/discovery/build-image.sh
|
||||
|
||||
|
||||
@@ -47,6 +47,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh fx_ingestor
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -75,7 +85,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/fx/build-image.sh
|
||||
|
||||
|
||||
@@ -48,6 +48,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh fx_oracle
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -76,7 +86,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/fx/build-image.sh
|
||||
|
||||
|
||||
@@ -46,6 +46,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh gateway_chain
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -74,7 +84,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/chain_gateway/build-image.sh
|
||||
|
||||
|
||||
@@ -45,6 +45,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh gateway_mntx
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -73,7 +83,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/mntx/build-image.sh
|
||||
|
||||
|
||||
@@ -43,6 +43,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh gateway_tgsettle
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -71,7 +81,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/tgsettle/build-image.sh
|
||||
|
||||
|
||||
@@ -46,6 +46,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh gateway_tron
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -74,7 +84,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/tron_gateway/build-image.sh
|
||||
|
||||
|
||||
@@ -42,6 +42,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh ledger
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -70,7 +80,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/ledger/build-image.sh
|
||||
|
||||
|
||||
@@ -45,6 +45,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh notification
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -73,7 +83,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/notification/build-image.sh
|
||||
|
||||
|
||||
@@ -43,6 +43,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh payments_methods
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -71,7 +81,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/payments_methods/build-image.sh
|
||||
|
||||
|
||||
@@ -43,6 +43,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh payments_orchestrator
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -71,7 +81,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/payments_orchestrator/build-image.sh
|
||||
|
||||
|
||||
@@ -43,6 +43,16 @@ steps:
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- bash ci/scripts/proto/generate.sh
|
||||
|
||||
- name: backend-lint
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
commands:
|
||||
- set -eu
|
||||
- apk add --no-cache bash git build-base
|
||||
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
|
||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
- sh ci/scripts/common/run_backend_lint.sh payments_quotation
|
||||
|
||||
- name: backend-tests
|
||||
image: golang:alpine
|
||||
depends_on: [ proto ]
|
||||
@@ -71,7 +81,7 @@ steps:
|
||||
|
||||
- name: build-image
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
depends_on: [ backend-tests, secrets ]
|
||||
depends_on: [ backend-lint, backend-tests, secrets ]
|
||||
commands:
|
||||
- sh ci/scripts/payments_quotation/build-image.sh
|
||||
|
||||
|
||||
19
README.md
19
README.md
@@ -110,6 +110,25 @@ make test-api # Run Go API tests only
|
||||
make test-frontend # Run Flutter tests only
|
||||
```
|
||||
|
||||
### Backend CI Bypass Tags
|
||||
|
||||
Backend Woodpecker module pipelines now run both lint and tests before image build/deploy.
|
||||
If you intentionally need to bypass checks for a specific commit, include one of these tags in the commit message:
|
||||
|
||||
```text
|
||||
[skip-lint:<service>] # Skip lint for one backend service pipeline
|
||||
[skip-lint] # Skip lint for all backend service pipelines
|
||||
[skip-tests:<service>] # Skip tests for one backend service pipeline
|
||||
[skip-tests] # Skip tests for all backend service pipelines
|
||||
[skip-autotests:<service>] # Alias for skip-tests:<service>
|
||||
[skip-autotests] # Alias for skip-tests
|
||||
[skip-checks:<service>] # Skip both lint and tests for one backend service pipeline
|
||||
[skip-checks] # Skip both lint and tests for all backend service pipelines
|
||||
```
|
||||
|
||||
`<service>` must match the backend pipeline key used by CI:
|
||||
`bff`, `callbacks`, `billing_documents`, `billing_fees`, `discovery`, `fx_ingestor`, `fx_oracle`, `gateway_chain`, `gateway_mntx`, `gateway_tgsettle`, `gateway_tron`, `ledger`, `notification`, `payments_methods`, `payments_orchestrator`, `payments_quotation`.
|
||||
|
||||
### Update Dependencies
|
||||
|
||||
```bash
|
||||
|
||||
111
ci/scripts/common/backend_modules.sh
Executable file
111
ci/scripts/common/backend_modules.sh
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
backend_service_modules() {
|
||||
service="${1:-}"
|
||||
case "${service}" in
|
||||
bff)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/edge/bff
|
||||
EOF
|
||||
;;
|
||||
callbacks)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/edge/callbacks
|
||||
EOF
|
||||
;;
|
||||
billing_documents)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/billing/documents
|
||||
EOF
|
||||
;;
|
||||
billing_fees)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/billing/fees
|
||||
EOF
|
||||
;;
|
||||
discovery)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/discovery
|
||||
EOF
|
||||
;;
|
||||
fx_ingestor)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/fx/storage
|
||||
api/fx/ingestor
|
||||
EOF
|
||||
;;
|
||||
fx_oracle)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/fx/storage
|
||||
api/fx/oracle
|
||||
EOF
|
||||
;;
|
||||
gateway_chain)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/gateway/chain
|
||||
EOF
|
||||
;;
|
||||
gateway_mntx)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/gateway/mntx
|
||||
EOF
|
||||
;;
|
||||
gateway_tgsettle)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/gateway/tgsettle
|
||||
EOF
|
||||
;;
|
||||
gateway_tron)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/gateway/tron
|
||||
EOF
|
||||
;;
|
||||
ledger)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/ledger
|
||||
EOF
|
||||
;;
|
||||
notification)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/notification
|
||||
EOF
|
||||
;;
|
||||
payments_methods)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/payments/storage
|
||||
api/payments/methods
|
||||
EOF
|
||||
;;
|
||||
payments_orchestrator)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/payments/storage
|
||||
api/payments/orchestrator
|
||||
EOF
|
||||
;;
|
||||
payments_quotation)
|
||||
cat <<'EOF'
|
||||
api/pkg
|
||||
api/payments/storage
|
||||
api/payments/quotation
|
||||
EOF
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
56
ci/scripts/common/run_backend_lint.sh
Executable file
56
ci/scripts/common/run_backend_lint.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
if ! set -o pipefail 2>/dev/null; then
|
||||
:
|
||||
fi
|
||||
|
||||
SERVICE="${1:-}"
|
||||
if [ -z "${SERVICE}" ]; then
|
||||
echo "usage: $0 <service-key>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
||||
cd "${REPO_ROOT}"
|
||||
|
||||
if bypass_reason="$(sh "${SCRIPT_DIR}/should_bypass_backend_check.sh" "${SERVICE}" lint)"; then
|
||||
echo "[backend-lint] ${bypass_reason}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! command -v golangci-lint >/dev/null 2>&1; then
|
||||
echo "[backend-lint] golangci-lint is required in PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck source=ci/scripts/common/backend_modules.sh
|
||||
. "${SCRIPT_DIR}/backend_modules.sh"
|
||||
|
||||
if ! modules="$(backend_service_modules "${SERVICE}")"; then
|
||||
echo "[backend-lint] unknown service key: ${SERVICE}" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
run_go_lint() {
|
||||
module="$1"
|
||||
if [ ! -f "${module}/go.mod" ]; then
|
||||
echo "[backend-lint] missing go.mod for module: ${module}" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "${module}/.golangci.yml" ]; then
|
||||
echo "[backend-lint] missing .golangci.yml for module: ${module}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[backend-lint] running golangci-lint in ${module}"
|
||||
(
|
||||
cd "${module}"
|
||||
golangci-lint run --timeout=10m ./...
|
||||
)
|
||||
}
|
||||
|
||||
for module in ${modules}; do
|
||||
run_go_lint "${module}"
|
||||
done
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
if ! set -o pipefail 2>/dev/null; then
|
||||
@@ -11,9 +11,23 @@ if [ -z "${SERVICE}" ]; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
||||
cd "${REPO_ROOT}"
|
||||
|
||||
if bypass_reason="$(sh "${SCRIPT_DIR}/should_bypass_backend_check.sh" "${SERVICE}" tests)"; then
|
||||
echo "[backend-tests] ${bypass_reason}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# shellcheck source=ci/scripts/common/backend_modules.sh
|
||||
. "${SCRIPT_DIR}/backend_modules.sh"
|
||||
|
||||
if ! modules="$(backend_service_modules "${SERVICE}")"; then
|
||||
echo "[backend-tests] unknown service key: ${SERVICE}" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
run_go_tests() {
|
||||
module="$1"
|
||||
if [ ! -f "${module}/go.mod" ]; then
|
||||
@@ -28,114 +42,6 @@ run_go_tests() {
|
||||
)
|
||||
}
|
||||
|
||||
case "${SERVICE}" in
|
||||
bff)
|
||||
modules="
|
||||
api/pkg
|
||||
api/edge/bff
|
||||
"
|
||||
;;
|
||||
callbacks)
|
||||
modules="
|
||||
api/pkg
|
||||
api/edge/callbacks
|
||||
"
|
||||
;;
|
||||
billing_documents)
|
||||
modules="
|
||||
api/pkg
|
||||
api/billing/documents
|
||||
"
|
||||
;;
|
||||
billing_fees)
|
||||
modules="
|
||||
api/pkg
|
||||
api/billing/fees
|
||||
"
|
||||
;;
|
||||
discovery)
|
||||
modules="
|
||||
api/pkg
|
||||
api/discovery
|
||||
"
|
||||
;;
|
||||
fx_ingestor)
|
||||
modules="
|
||||
api/pkg
|
||||
api/fx/storage
|
||||
api/fx/ingestor
|
||||
"
|
||||
;;
|
||||
fx_oracle)
|
||||
modules="
|
||||
api/pkg
|
||||
api/fx/storage
|
||||
api/fx/oracle
|
||||
"
|
||||
;;
|
||||
gateway_chain)
|
||||
modules="
|
||||
api/pkg
|
||||
api/gateway/chain
|
||||
"
|
||||
;;
|
||||
gateway_mntx)
|
||||
modules="
|
||||
api/pkg
|
||||
api/gateway/mntx
|
||||
"
|
||||
;;
|
||||
gateway_tgsettle)
|
||||
modules="
|
||||
api/pkg
|
||||
api/gateway/tgsettle
|
||||
"
|
||||
;;
|
||||
gateway_tron)
|
||||
modules="
|
||||
api/pkg
|
||||
api/gateway/tron
|
||||
"
|
||||
;;
|
||||
ledger)
|
||||
modules="
|
||||
api/pkg
|
||||
api/ledger
|
||||
"
|
||||
;;
|
||||
notification)
|
||||
modules="
|
||||
api/pkg
|
||||
api/notification
|
||||
"
|
||||
;;
|
||||
payments_methods)
|
||||
modules="
|
||||
api/pkg
|
||||
api/payments/storage
|
||||
api/payments/methods
|
||||
"
|
||||
;;
|
||||
payments_orchestrator)
|
||||
modules="
|
||||
api/pkg
|
||||
api/payments/storage
|
||||
api/payments/orchestrator
|
||||
"
|
||||
;;
|
||||
payments_quotation)
|
||||
modules="
|
||||
api/pkg
|
||||
api/payments/storage
|
||||
api/payments/quotation
|
||||
"
|
||||
;;
|
||||
*)
|
||||
echo "[backend-tests] unknown service key: ${SERVICE}" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
for module in ${modules}; do
|
||||
run_go_tests "${module}"
|
||||
done
|
||||
|
||||
77
ci/scripts/common/should_bypass_backend_check.sh
Executable file
77
ci/scripts/common/should_bypass_backend_check.sh
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
SERVICE="${1:-}"
|
||||
CHECK="${2:-}"
|
||||
|
||||
if [ -z "${SERVICE}" ] || [ -z "${CHECK}" ]; then
|
||||
echo "usage: $0 <service-key> <lint|tests>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
COMMIT_MESSAGE="${WOODPECKER_COMMIT_MESSAGE:-${CI_COMMIT_MESSAGE:-${GIT_COMMIT_MESSAGE:-}}}"
|
||||
if [ -z "${COMMIT_MESSAGE}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
contains_token() {
|
||||
token="$1"
|
||||
printf '%s' "${COMMIT_MESSAGE}" | grep -Fq -- "${token}"
|
||||
}
|
||||
|
||||
emit_skip() {
|
||||
token="$1"
|
||||
scope="$2"
|
||||
printf 'bypass enabled by token %s (%s scope)' "${token}" "${scope}"
|
||||
exit 0
|
||||
}
|
||||
|
||||
if contains_token "[skip-checks]"; then
|
||||
emit_skip "[skip-checks]" "all-modules"
|
||||
fi
|
||||
if contains_token "[skip-checks:all]"; then
|
||||
emit_skip "[skip-checks:all]" "all-modules"
|
||||
fi
|
||||
if contains_token "[skip-checks:${SERVICE}]"; then
|
||||
emit_skip "[skip-checks:${SERVICE}]" "service"
|
||||
fi
|
||||
|
||||
case "${CHECK}" in
|
||||
lint)
|
||||
if contains_token "[skip-lint]"; then
|
||||
emit_skip "[skip-lint]" "all-modules"
|
||||
fi
|
||||
if contains_token "[skip-lint:all]"; then
|
||||
emit_skip "[skip-lint:all]" "all-modules"
|
||||
fi
|
||||
if contains_token "[skip-lint:${SERVICE}]"; then
|
||||
emit_skip "[skip-lint:${SERVICE}]" "service"
|
||||
fi
|
||||
;;
|
||||
tests)
|
||||
if contains_token "[skip-tests]"; then
|
||||
emit_skip "[skip-tests]" "all-modules"
|
||||
fi
|
||||
if contains_token "[skip-tests:all]"; then
|
||||
emit_skip "[skip-tests:all]" "all-modules"
|
||||
fi
|
||||
if contains_token "[skip-tests:${SERVICE}]"; then
|
||||
emit_skip "[skip-tests:${SERVICE}]" "service"
|
||||
fi
|
||||
if contains_token "[skip-autotests]"; then
|
||||
emit_skip "[skip-autotests]" "all-modules"
|
||||
fi
|
||||
if contains_token "[skip-autotests:all]"; then
|
||||
emit_skip "[skip-autotests:all]" "all-modules"
|
||||
fi
|
||||
if contains_token "[skip-autotests:${SERVICE}]"; then
|
||||
emit_skip "[skip-autotests:${SERVICE}]" "service"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "unsupported check: ${CHECK}" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 1
|
||||
Reference in New Issue
Block a user