From 903548c03060e95b239962c8277419ea2a332a97 Mon Sep 17 00:00:00 2001 From: Firmino Date: Fri, 1 Sep 2023 21:17:43 -0300 Subject: [PATCH] Fix pipeline and add more tests --- .github/workflows/ci.yml | 25 ++++++++++++++++++++----- makefile | 5 ++++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fca802..fa57330 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,11 +5,29 @@ on: branches: [ main ] pull_request: branches: [ main ] - + jobs: - build: + test_compile_rest_application: 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: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o webhook adapters/rest/*.go + test_compile_docker_image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Go + run: make docker-build + + running_all_tests: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup Go @@ -20,8 +38,5 @@ jobs: - name: Install dependencies run: go mod tidy - - name: Build - run: make build - - name: Test with the Go CLI run: make test \ No newline at end of file diff --git a/makefile b/makefile index b15f46d..9214268 100644 --- a/makefile +++ b/makefile @@ -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