Skip to content

Commit fa151fc

Browse files
committed
Add test-and-lint.yml
1 parent 60d8d25 commit fa151fc

File tree

9 files changed

+88
-6
lines changed

9 files changed

+88
-6
lines changed

.github/workflows/build.yml renamed to .github/workflows/SonarQube.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: SonarQube
22
on:
33
push:
44
branches:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: test-and-lint
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- '**'
9+
10+
jobs:
11+
check-project-quality:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: '1.24'
20+
cache: true
21+
22+
- name: Install dependencies
23+
run: |
24+
go mod download
25+
go mod tidy
26+
27+
- name: Install golangci-lint
28+
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
29+
30+
- name: Verify installation
31+
run: |
32+
which golangci-lint
33+
golangci-lint version
34+
35+
- name: Run tests
36+
run: make test
37+
38+
- name: Run linter
39+
run: make lint

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/go-project-244.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
## Команда сборки исполняемого файла
1+
# Собирает бинарный файл в bin/gendiff
22
build:
33
go build -o bin/gendiff ./cmd/gendiff
44

5+
# Устанавливает собранный бинарник в GOBIN, чтобы его можно было запускать из любого места.
56
install: build
67
go install ./cmd/gendiff
8+
9+
# Запуск линтера
10+
lint:
11+
golangci-lint run
12+
13+
# Запуск тестов
14+
test:
15+
go test -v ./...
16+

cmd/gendiff/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"log"
88
"os"
99

10-
"github.com/urfave/cli/v3"
10+
cli "github.com/urfave/cli/v3"
1111
)
1212

1313
func main() {

go.mod

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
module code
22

3-
go 1.24.5
3+
go 1.24
44

5-
require github.com/urfave/cli/v3 v3.4.1
5+
require (
6+
github.com/stretchr/testify v1.11.1
7+
github.com/urfave/cli/v3 v3.4.1
8+
)
69

710
require (
811
github.com/davecgh/go-spew v1.1.1 // indirect
912
github.com/pmezard/go-difflib v1.0.0 // indirect
10-
github.com/stretchr/testify v1.11.1
1113
gopkg.in/yaml.v3 v3.0.1 // indirect
1214
)

0 commit comments

Comments
 (0)