Skip to content

Commit

Permalink
Updating CI to use Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseward committed Dec 11, 2023
1 parent 611e690 commit 7834c57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go
name: Build and Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:

Expand All @@ -22,7 +17,7 @@ jobs:
go-version: '1.20'

- name: Build
run: go build -v ./...
run: make setup build

- name: Test
run: make test
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ setup:

.PHONY: build
build: clean
go build -v -o dist/cli cmd/pt/main.go
@echo "==> Building Packages <=="
go build -v ./...
@echo "==> Building cli <=="
go build -o dist/cli cmd/pt/main.go

.PHONY: test
test:
@echo "==> running Go tests <=="
go test -race ./...


.PHONY: fmt
fmt:
go fmt ./...

.PHONY: clean
clean:
@echo "==> Cleaning dist/ <=="
rm -fr dist/*

0 comments on commit 7834c57

Please sign in to comment.