Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,21 @@ jobs:
go-version: '1.23'
cache: true

- name: Install Task
run: |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install dependencies
run: |
go mod download
go mod tidy

- name: Run go fmt
- name: Run go fmt check
run: |
unformatted=$(gofmt -s -l $(find . -name '*.go' -not -path './vendor/*' -not -path './.git/*' 2>/dev/null))
if [ -n "$unformatted" ]; then
echo "Please run 'go fmt ./...'"
echo "Please run 'task fmt' to format code"
echo "$unformatted"
exit 1
fi
Expand All @@ -56,8 +61,7 @@ jobs:
- name: Run tests
env:
POSTGRES_DSN: "postgres://postgres:postgres@localhost:5432/linkkeeper_test?sslmode=disable"
run: |
go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
run: task test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -80,6 +84,11 @@ jobs:
with:
go-version: '1.23'

- name: Install Task
run: |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
with:
Expand All @@ -101,14 +110,16 @@ jobs:
go-version: '1.23'
cache: true

- name: Build api-service
run: go build -v -o bin/api-service ./cmd/api-service

- name: Build user-service
run: go build -v -o bin/user-service ./cmd/user-service
- name: Install Task
run: |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Build bot-service
run: go build -v -o bin/bot-service ./cmd/bot-service
- name: Build all services
run: |
task api:build
task user:build
task bot:build

docker:
name: Docker Build
Expand Down
41 changes: 0 additions & 41 deletions Makefile

This file was deleted.

12 changes: 9 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ tasks:
desc: Check Go code with linter
cmds:
- go vet ./...
- golangci-lint run --timeout=5m || echo "golangci-lint not installed. Run: brew install golangci-lint"
- |
if ! command -v golangci-lint &> /dev/null; then
echo "golangci-lint not installed. Run: brew install golangci-lint"
exit 1
fi
golangci-lint run --timeout=5m

test:
desc: Run all tests
Expand All @@ -261,8 +266,9 @@ tasks:
cmds:
- go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
- go tool cover -html=coverage.out -o coverage.html
- echo "Coverage report generated: coverage.html"
- go tool cover -func=coverage.out | grep total
- |
echo "Coverage report generated: coverage.html"
go tool cover -func=coverage.out | grep total || true

test:watch:
desc: Watch and run tests on file changes
Expand Down
Loading
Loading