Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nancy checks #192

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7253c53
Document the DDD approach
May 7, 2023
c2feae3
Remove old directory references about http and rpc
May 7, 2023
f775c1f
Add section about access flow from interfaces to domain
May 9, 2023
1db54e2
Create integration tests using Go httptest for health check endpoint
May 9, 2023
d6e65bc
Add docs about httptest
May 9, 2023
2f307b5
Correct spelling issue in the httptest section
May 9, 2023
b91460c
Setup testcontainer for rmq and postgres
May 10, 2023
ee23c3d
Migration 2nd integration-test to testcontainer tests that requires d…
May 12, 2023
fc6d6b6
Remove old integration tests
May 12, 2023
d099ca6
Configure reuse true for testcontainers to enable TDD using testconta…
May 13, 2023
fc207c9
Update GitHub CI script to run all tests
May 13, 2023
e41dbda
Update ci.yml to execute on each push
sesigl May 13, 2023
d9ec8bb
Set go version to 1.20
May 14, 2023
e49f919
Set go version to 1.19.4
May 14, 2023
5fe6c9d
Set go version to 1.19.4
May 14, 2023
4ce7770
Update codecov link to show coverage on GH page
May 14, 2023
e3f2dda
Remove nancy from GH actions because it fails but it can not be fixed
May 14, 2023
84f5fc1
Run reviewdog gh-check instead of pr related reported
May 15, 2023
6ed02cb
Try with github-pr-check
May 15, 2023
36325dc
Try with pr-review
May 15, 2023
e92af43
Replace hadolint with a direct integration instead of reviewdog
May 15, 2023
1fb807e
Make hadolint fail
May 15, 2023
76f008d
Try again with reviewdog
May 15, 2023
57d0da5
Use the working setup with hadolint
May 15, 2023
58ef15b
Revert dockerfile
May 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 6 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CI
on: pull_request
on: [push]

jobs:
golangci-lint:
Expand Down Expand Up @@ -27,10 +27,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-hadolint@v1
- uses: hadolint/hadolint-action@v3.1.0
with:
fail_on_error: true
reporter: github-pr-review
recursive: true
dockerfile: Dockerfile

dotenv-linter:
name: runner / dotenv-linter
Expand All @@ -41,39 +41,16 @@ jobs:
with:
reporter: github-pr-review

check-dependencies:
name: runner / check-dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
- name: WriteGoList
run: go list -json -m all > go.list
- name: Nancy
uses: sonatype-nexus-community/nancy-github-action@main
continue-on-error: true

tests:
name: runner / tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
with:
go-version: 1.17

go-version: "1.19.4"
- name: Unit Tests
run: "go test \
-v \
-race \
-covermode atomic \
-coverprofile=coverage.txt \
./internal/..."
run: "make test"
- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)

- name: Integration tests
run: "docker-compose up \
--build \
--abort-on-container-exit \
--exit-code-from integration"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ bin/
*.out

# Dependency directories (remove the comment below to include it)
vendor/
vendor/

# coverage files
coverage.txt
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ COPY --from=builder /app/config /config
COPY --from=builder /app/migrations /migrations
COPY --from=builder /bin/app /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
CMD ["/app"]
CMD ["/app"]
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ compose-up: ### Run docker-compose
docker-compose up --build -d postgres rabbitmq && docker-compose logs -f
.PHONY: compose-up

compose-up-integration-test: ### Run docker-compose with integration test
docker-compose up --build --abort-on-container-exit --exit-code-from integration
.PHONY: compose-up-integration-test

compose-down: ### Down docker-compose
docker-compose down --remove-orphans
.PHONY: compose-down
Expand All @@ -42,20 +38,20 @@ linter-golangci: ### check by golangci linter
.PHONY: linter-golangci

linter-hadolint: ### check by hadolint linter
git ls-files --exclude='Dockerfile*' --ignored | xargs hadolint
find . -name 'Dockerfile' | xargs hadolint
.PHONY: linter-hadolint

linter-dotenv: ### check by dotenv linter
dotenv-linter
.PHONY: linter-dotenv

test: ### run test
go test -v -cover -race ./internal/...
test: ### run all tests including slow running system (e.g. system-tests)
go test --tags=system -v -cover -covermode atomic -coverprofile=coverage.txt ./internal/... ./pkg/...
.PHONY: test

integration-test: ### run integration-test
go clean -testcache && go test -v ./integration-test/...
.PHONY: integration-test
test-fast: ### run fast tests only
go test -v -cover ./internal/... ./pkg/...
.PHONY: test-fast

mock: ### run mockgen
mockgen -source ./internal/usecase/interfaces.go -package usecase_test > ./internal/usecase/mocks_test.go
Expand Down