From 97fb2000e346f52af51c9cb698448c325a8a92ca Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 24 Feb 2023 23:30:09 +0800 Subject: [PATCH] Enable action as CI to test/build/release (#26) Reviewed-on: https://gitea.com/gitea/act_runner/pulls/26 --- .gitea/workflows/lint.yml | 21 --------------------- .gitea/workflows/test.yml | 23 +++++++++++++++++++++++ .gitignore | 1 + Makefile | 4 ++-- 4 files changed, 26 insertions(+), 23 deletions(-) delete mode 100644 .gitea/workflows/lint.yml create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml deleted file mode 100644 index 97e5326..0000000 --- a/.gitea/workflows/lint.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: checks -on: [push] - -env: - GOPROXY: https://goproxy.io,direct - -jobs: - lint: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v3 - with: - go-version: 1.17 - - uses: actions/checkout@v3 - - uses: Jerome1337/golint-action@v1.0.2 - #- name: golangci-lint - # uses: golangci/golangci-lint-action@v3 - # with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - # version: v1.29 \ No newline at end of file diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..bf34338 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,23 @@ +name: checks +on: + - push + - pull_request + +env: + GOPROXY: https://goproxy.io,direct + +jobs: + lint: + name: check and test + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v3 + with: + go-version: 1.20 + - uses: actions/checkout@v3 + - name: vet checks + run: make vet + - name: build + run: make build + - name: test + run: make test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4bd1d0b..82ec058 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ act_runner .env .runner +coverage.txt \ No newline at end of file diff --git a/Makefile b/Makefile index 3092f42..d5a1805 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ all: build fmt: @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) install -u mvdan.cc/gofumpt; \ + $(GO) install mvdan.cc/gofumpt@latest; \ fi $(GOFMT) -w $(GOFILES) @@ -77,7 +77,7 @@ vet: .PHONY: fmt-check fmt-check: @hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ - $(GO) install -u mvdan.cc/gofumpt; \ + $(GO) install mvdan.cc/gofumpt@latest; \ fi @diff=$$($(GOFMT) -d $(GOFILES)); \ if [ -n "$$diff" ]; then \