Skip to content

Commit

Permalink
Fix pipeline and add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelgfirmino committed Sep 2, 2023
1 parent 8010516 commit ee293ac
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,34 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
test_compile_rest_application:
name: Check create rest bin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Install dependencies
run: go mod tidy

- name: Build image
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o webhook adapters/rest/*.go

test_compile_docker_image:
name: Check create Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: create image docker
run: make docker-build

running_all_tests:
name: Running tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
Expand All @@ -18,10 +41,7 @@ jobs:
go-version: '1.21.x'

- name: Install dependencies
run: go mod tidy

- name: Build
run: make build
run: go mod tidy

- name: Test with the Go CLI
- name: run test
run: make test
5 changes: 4 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
docker-build:
@docker build -t webhook:latest .

up-build:
@docker-compose up -d --build

up:
@docker-compose up -d --build
@docker-compose up -d

down:
@docker-compose down
Expand Down

0 comments on commit ee293ac

Please sign in to comment.