diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 0000000..c0922ef --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,20 @@ +name: Build and test +on: [push] + +jobs: + build_and_test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go 1.21 + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Build binary + run: make build + + - name: Run tests + run: make testv diff --git a/Makefile b/Makefile index b09630f..c8a1d98 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,12 @@ dev: bin fmt: goimports -w . + test: - go test ./... + go test $(TEST_FLAGS) $(shell go list ./...) + +testv: TEST_FLAGS += -v +testv: test vet: go vet ./...