Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
habedi committed Jan 28, 2025
1 parent 3cbcb95 commit de7692a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ jobs:
runs-on: ubuntu-latest

steps:
# Checkout code from repository
- name: Checkout code
uses: actions/checkout@v4

# Set up Go environment
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'

- name: Install golangci-lint
# Install golangci-lint
- name: Install dependencies
run: |
make install-deps
- name: Run golangci-lint
# Run linters
- name: Run linters
run: |
make lint
continue-on-error: false
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Run Tests and Generate Coverage Report
run: |
make test
make codecov
make coverage # Generates a coverage.txt file
continue-on-error: false

# Upload the coverage report to Codecov
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PKG = github.com/habedi/gogg
BINARY_NAME = $(or $(GOGG_BINARY), $(notdir $(PKG)))
BINARY = bin/$(BINARY_NAME)
COVER_PROFILE = cover.out
COVER_PROFILE = coverage.txt
GO_FILES = $(shell find . -type f -name '*.go')
COVER_FLAGS = --cover --coverprofile=$(COVER_PROFILE)
CUSTOM_SNAPCRAFT_BUILD_ENVIRONMENT = $(or $(SNAP_BACKEND), multipass)
Expand Down Expand Up @@ -39,17 +39,13 @@ coverage: ## Run tests with coverage and show the coverage report in output
@echo "Displaying coverage report as a table..."
go tool cover -func=$(COVER_PROFILE)

.PHONY: codecov
codecov: format ## Create test coverage report for Codecov
@echo "Uploading coverage report to Codecov..."
go test -coverprofile=coverage.txt ./...

.PHONY: clean
clean: ## Remove generated and temporary files
@echo "Cleaning up..."
find . -type f -name '*.got.*' -delete
find . -type f -name '*.out' -delete
find . -type f -name '*.snap' -delete
rm -f $(COVER_PROFILE)
rm -rf bin/

.PHONY: run
Expand Down

0 comments on commit de7692a

Please sign in to comment.