Skip to content

Commit

Permalink
Configure github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerasimchuk committed Oct 26, 2023
1 parent ea79828 commit 116289d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/test-integration.yml
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
16 changes: 16 additions & 0 deletions .github/workflows/test-unit.yml
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
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ 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-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:
docker-compose -f ${DOCKER_COMPOSE_FILENAME} run test-integration-api
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Test Unit][test-unit-badge]][test-unit-url]

# Space Trouble

## Requirements
Expand Down Expand Up @@ -117,3 +119,6 @@ Technical requirements:
* Please, use github or bitbucket.

* Commit your changes often. Do not push the whole project in one commit.

[test-unit-badge]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-unit.yml/badge.svg
[test-unit-url]: https://github.com/mgerasimchuk/space-trouble/actions/workflows/test-unit.yml

0 comments on commit 116289d

Please sign in to comment.