1
0
mirror of https://github.com/xorcare/testing-go-code-with-postgres.git synced 2025-06-30 23:23:40 +02:00

Fix linter issues and simplify yaml files

This commit is contained in:
Vasiliy Vasilyuk
2024-10-06 16:37:16 +03:00
parent b7eb482b87
commit a2d02fb915
5 changed files with 27 additions and 23 deletions

View File

@ -1,13 +1,14 @@
---
# See https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file # See https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2 version: 2
updates: updates:
- package-ecosystem: "gomod" - package-ecosystem: gomod
directory: "/" directory: /
schedule: schedule:
interval: "weekly" interval: weekly
- package-ecosystem: "github-actions" - package-ecosystem: github-actions
directory: "/" directory: /
schedule: schedule:
interval: "weekly" interval: weekly

View File

@ -1,11 +1,11 @@
---
name: Go name: Go
on: on:
push: push:
pull_request: pull_request:
branches: ["main"] branches: [main]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
test: test:
name: test name: test
@ -16,7 +16,7 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.22.0' go-version: 1.22.0
- name: Check that all packages are compiling - name: Check that all packages are compiling
run: make build run: make build
@ -49,12 +49,12 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.22.0' go-version: 1.22.0
- name: Check actuality of go.mod and go.sum - name: Check actuality of go.mod and go.sum
run: | run: |
go mod tidy go mod tidy
git diff --exit-code && exit 0 || true git diff --exit-code && exit 0 || true
echo '######################################################################' echo '######################################################################'
echo echo
echo "ERROR: go.mod or go.sum is different from the committed version" echo "ERROR: go.mod or go.sum is different from the committed version"
@ -71,7 +71,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: '1.22.0' go-version: 1.22.0
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v6
with: with:

View File

@ -1,3 +1,4 @@
---
image: golang:1.22 image: golang:1.22
stages: stages:
@ -47,7 +48,7 @@ test:
coverage_report: coverage_report:
coverage_format: cobertura coverage_format: cobertura
path: coverage.xml path: coverage.xml
coverage: '/^total:\s+\(statements\)\s+(\d+(?:\.\d+)?%)/' coverage: /^total:\s+\(statements\)\s+(\d+(?:\.\d+)?%)/
only: only:
- branches - branches
@ -59,13 +60,13 @@ check-go-modules:
script: script:
- go mod tidy - go mod tidy
- | - |
git diff --exit-code && exit 0 || true git diff --exit-code && exit 0 || true
echo -e "\033[0;31m" echo -e "\033[0;31m"
echo '######################################################################' echo '######################################################################'
echo echo
echo "ERROR: go.mod or go.sum is different from the committed version" echo "ERROR: go.mod or go.sum is different from the committed version"
echo "Try using 'go mod tidy' to fix the go.mod and go.sum files" echo "Try using 'go mod tidy' to fix the go.mod and go.sum files"
echo "Also, don't forget to commit and push changes" echo "Also, don't forget to commit and push changes"
echo echo
echo '######################################################################' echo '######################################################################'
exit 1 exit 1

View File

@ -1,3 +1,4 @@
---
linters: linters:
disable-all: true disable-all: true
enable: enable:

View File

@ -1,3 +1,4 @@
---
version: "3.8" version: "3.8"
services: services:
@ -15,7 +16,7 @@ services:
retries: 5 retries: 5
timeout: 5s timeout: 5s
ports: ports:
- "32260:5432" - 32260:5432
volumes: volumes:
- ./docker-multiple-databases.sh:/docker-entrypoint-initdb.d/docker-multiple-databases.sh:ro - ./docker-multiple-databases.sh:/docker-entrypoint-initdb.d/docker-multiple-databases.sh:ro
tmpfs: tmpfs: