Skip to content

Commit f3a4de5

Browse files
author
Dmitrii Shcherbakov
committed
Big refactoring
1 parent b3aae69 commit f3a4de5

File tree

184 files changed

+47408
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+47408
-173
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
GEEKSONATOR_TELEGRAM_BOT_TOKEN=bot_token_here
2+
GEEKSONATOR_TELEGRAM_TIMEOUT_SECONDS=15
3+
GEEKSONATOR_DEBUG_MODE=false
4+
GEEKSONATOR_DEBUG_TELEGRAM_BOT_TOKEN=debug_bot_token_here

.github/workflows/audit.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: audit
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
audit:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout GitHub Action
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version-file: ./go.mod
23+
cache-dependency-path: ./go.sum
24+
25+
- name: Run golangci-lint
26+
uses: golangci/golangci-lint-action@v6
27+
with:
28+
version: v1.55.2
29+
working-directory: ./
30+
31+
- name: Install dependencies
32+
run: |
33+
go mod tidy
34+
go mod vendor
35+
go install github.com/vektra/mockery/[email protected]
36+
37+
- name: Run test
38+
run: go test ./...

.github/workflows/container.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: deploy to ghcr.io
2+
3+
on:
4+
push:
5+
# run only against tags
6+
tags:
7+
- "*"
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
push-image:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout GitHub Action
17+
uses: actions/checkout@main
18+
19+
- name: Fetch tags
20+
run: git fetch --force --tags
21+
22+
- name: Display tag
23+
run: echo ${{github.ref_name}}
24+
25+
- name: Login to GitHub Container Registry
26+
uses: docker/login-action@v1
27+
with:
28+
registry: ghcr.io
29+
username: ${{github.actor}}
30+
password: ${{secrets.GITHUB_TOKEN}}
31+
32+
- name: Build Image
33+
run: docker build . --tag ghcr.io/phpgeeks-club/geeksonator:${{github.ref_name}}
34+
35+
- name: Push Image
36+
run: docker push ghcr.io/phpgeeks-club/geeksonator:${{github.ref_name}}

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
# run only against tags
6+
tags:
7+
- "*"
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
goreleaser:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout GitHub Action
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Fetch tags
22+
run: git fetch --force --tags
23+
24+
- name: Display tag
25+
run: echo ${{github.ref_name}}
26+
27+
- name: Setup Go
28+
uses: actions/setup-go@v4
29+
with:
30+
go-version: stable
31+
32+
- name: Display Go version
33+
run: go version
34+
35+
- name: Create release
36+
uses: goreleaser/goreleaser-action@v5
37+
with:
38+
distribution: goreleaser
39+
version: latest
40+
args: release --clean
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin/
2+
dist/
3+
.env
4+
.gitignore

.golangci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
run:
2+
concurrency: 4
3+
timeout: 5m
4+
5+
linters:
6+
disable-all: true
7+
enable:
8+
- asasalint
9+
- asciicheck
10+
- bidichk
11+
- bodyclose
12+
- containedctx
13+
- contextcheck
14+
- cyclop
15+
- dogsled
16+
- dupl
17+
- durationcheck
18+
- errcheck
19+
- errchkjson
20+
- errname
21+
- errorlint
22+
- exhaustive
23+
- exportloopref
24+
- forcetypeassert
25+
- gci
26+
- gocheckcompilerdirectives
27+
- gochecknoglobals
28+
- gochecknoinits
29+
- gocognit
30+
- goconst
31+
- gocritic
32+
- gocyclo
33+
- godot
34+
- godox
35+
- gofmt
36+
- goimports
37+
- gomnd
38+
- goprintffuncname
39+
- gosec
40+
- gosimple
41+
- govet
42+
- importas
43+
- ineffassign
44+
- maintidx
45+
- makezero
46+
- misspell
47+
- musttag
48+
- nakedret
49+
- nestif
50+
- nilerr
51+
- nilnil
52+
- nlreturn
53+
- noctx
54+
- nolintlint
55+
- nosprintfhostport
56+
- paralleltest
57+
- prealloc
58+
- predeclared
59+
- reassign
60+
- revive
61+
- staticcheck
62+
- stylecheck
63+
- tagliatelle
64+
- thelper
65+
- typecheck
66+
- unconvert
67+
- unparam
68+
- unused
69+
- usestdlibvars
70+
- whitespace
71+
- wrapcheck
72+
73+
linters-settings:
74+
errorlint:
75+
errorf: false
76+
gci:
77+
sections:
78+
- standard
79+
- default
80+
- prefix(geeksonator)
81+
gocognit:
82+
min-complexity: 10
83+
gocyclo:
84+
min-complexity: 10
85+
nestif:
86+
min-complexity: 4
87+
unparam:
88+
check-exported: true

.goreleaser.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
project_name: geeksonator
2+
builds:
3+
- id: geeksonator
4+
env:
5+
- CGO_ENABLED=0
6+
goos:
7+
- linux
8+
goarch:
9+
- amd64
10+
flags:
11+
- -trimpath
12+
ldflags:
13+
- -s -w
14+
main: ./cmd/geeksonator
15+
binary: ./bin/geeksonator

.mockery.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
quiet: true
2+
with-expecter: true
3+
disable-config-search: true
4+
dir: "{{.InterfaceDir}}/mocks"
5+
mockname: "{{.InterfaceName}}Mock"
6+
filename: "{{.InterfaceName | snakecase}}_mock.go"
7+
outpkg: "mocks"
8+
packages:
9+
geeksonator/internal/observer:
10+
geeksonator/internal/provider/telegram:

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
golang 1.21.4
2+
golangci-lint 1.55.2

0 commit comments

Comments
 (0)