From 987940dc1bb98a8335ab3959709cae9842640078 Mon Sep 17 00:00:00 2001 From: Ryo Takaishi Date: Thu, 29 Aug 2024 17:46:28 +0900 Subject: [PATCH] chore: add ci --- .github/workflows/test.yml | 19 +++++++++++++++++++ Makefile | 9 +++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ef875f0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,19 @@ +name: test + +on: + pull_request: + branches: [ main ] + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.21 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: make build + - run: make test diff --git a/Makefile b/Makefile index db4a2e3..c6d4c70 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ - -build: +.PHONY: build +build: test go build -o dist/tfclean ./cmd/tfclean +.PHONY: install install: go install github.com/takaishi/tfclean/cmd/tfclean + +.PHONY: test +test: + go test -race ./...