Skip to content

Commit

Permalink
testing improvements [ci nobuild]
Browse files Browse the repository at this point in the history
  • Loading branch information
bleaker0x committed Jan 11, 2022
1 parent 97e708e commit 9498179
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
strategy:
matrix:
go-version:
- 1.16.x
- 1.17.x
- 1.18.0-beta1
platform:
- ubuntu-latest
runs-on: ${{ matrix.platform }}
Expand All @@ -23,6 +25,7 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
stable: ${{ !contains(matrix.go-version, 'beta') }}

- name: Go modules cache
uses: actions/cache@v2
Expand All @@ -33,7 +36,7 @@ jobs:
${{ runner.os }}-go-
- name: Run Tests
run: go test -v -coverprofile=profile.cov ./...
run: make test-ci

- name: Send coverage
uses: shogo82148/actions-goveralls@v1
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.idea/
vendor/

.env
.env

scripts/
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@


.PHONY: test lint fmt fmt-all generate
.PHONY: test lint fmt fmt-all generate test-local setup

test:
@env ROOT_DIR="$(shell echo $$PWD)" go test ./... -v
@go test ./... -v

test-ci:
go test -v -coverprofile=profile.cov ./...

test-local: setup
@./scripts/shdotenv -e .env go test -v ./...

lint:
golangci-lint run --config .golangci.yml
@golangci-lint run --config .golangci.yml

fmt:
gofmt -s -w $(FILE)
@gofmt -s -w $(FILE)

fmt-all:
gofmt -s -w ./..
@gofmt -s -w ./..

setup:
@mkdir -p ./scripts
@if [[ ! -f ./scripts/shdotenv ]]; then wget https://github.com/ko1nksm/shdotenv/releases/latest/download/shdotenv -O ./scripts/shdotenv; chmod +x ./scripts/shdotenv; fi

0 comments on commit 9498179

Please sign in to comment.