-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea79828
commit d78f739
Showing
6 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Test Integration | ||
on: push | ||
|
||
jobs: | ||
test-integration-api: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Test Integration | ||
run: make test-integration-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Test Unit | ||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Test Unit | ||
run: make test-unit | ||
# test-integration-api: | ||
# runs-on: ubuntu-22.04 | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Test Unit | ||
# run: make test-integration-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
DOCKER_COMPOSE_FILENAME=deployments/docker-compose/docker-compose.yaml | ||
|
||
start: vendor-install | ||
docker-compose -f ${DOCKER_COMPOSE_FILENAME} down -v --remove-orphans ; docker-compose -f ${DOCKER_COMPOSE_FILENAME} up -d | ||
start-from-scratch: vendor-install | ||
docker-compose -f ${DOCKER_COMPOSE_FILENAME} down -v --remove-orphans ; docker-compose -f ${DOCKER_COMPOSE_FILENAME} up --build -d | ||
docker-compose -f ${DOCKER_COMPOSE_FILENAME} up -d | ||
start-from-scratch: stop | ||
docker-compose --file ${DOCKER_COMPOSE_FILENAME} --profile httpapi up --remove-orphans --renew-anon-volumes --force-recreate --build -d | ||
stop: | ||
docker-compose -f ${DOCKER_COMPOSE_FILENAME} down | ||
restart: stop start | ||
logs-api: | ||
docker-compose -f ${DOCKER_COMPOSE_FILENAME} logs -f api | ||
logs-verifier: | ||
docker-compose -f ${DOCKER_COMPOSE_FILENAME} logs -f verifier | ||
test: | ||
docker run -v $(shell pwd):/app golang:1.20.0 /bin/bash -c 'cd /app && GO111MODULE=on go test -mod vendor -covermode=count -coverprofile=assets/coverage/coverage.out -v ./... && go tool cover -html=assets/coverage/coverage.out -o=assets/coverage/coverage.html' | ||
test-integration-api: | ||
test-unit: vendor-install | ||
docker run -v $(shell pwd):/app -w /app golang:1.20.0 /bin/bash \ | ||
-c 'go test -covermode=count -coverprofile=assets/coverage/coverage.out -v ./internal/... && go tool cover -html=assets/coverage/coverage.out -o=assets/coverage/coverage.html' | ||
test-integration-api: start | ||
docker-compose -f ${DOCKER_COMPOSE_FILENAME} run test-integration-api | ||
lint-golangci: vendor-install | ||
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v1.50.1 \ | ||
golangci-lint run --timeout 5m30s -v | ||
lint-architecture: | ||
docker run --rm -v $(shell pwd):/app -w /app golang:1.20.0 /bin/bash -c "go install github.com/fdaines/[email protected] && arch-go -v" | ||
docker run --rm -v $(shell pwd):/app -w /app golang:1.20.0 /bin/bash \ | ||
-c "go install github.com/fdaines/[email protected] && arch-go -v" | ||
vendor-install: | ||
@if [ -d "vendor" ]; then echo "Vendor folder already exists. Skip vendor installing."; else docker run --rm -v $(shell pwd):/app -w /app golang:1.20.0 /bin/bash -c "go mod tidy && go mod vendor"; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters