From 61158a0ed3ceb0f6994fd7cdd2293ed7695bfcf8 Mon Sep 17 00:00:00 2001 From: David Morrison Date: Wed, 21 Feb 2024 14:53:50 -0800 Subject: [PATCH] add GitHub workflows --- .github/FUNDING.yml | 1 + .github/workflows/verify.yml | 56 ++++++++++++++++++++++++++++++++++++ Makefile | 2 +- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/verify.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..897db9c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: acrlabs diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..4a43638 --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,56 @@ +name: code verification +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out repo and build scripts + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Install Golang + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + - name: Build + run: make build + + test: + runs-on: ubuntu-latest + steps: + - name: Check out repo and build scripts + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Install Golang + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + - name: Lint Go code + uses: golangci/golangci-lint-action@v3 + with: + version: v1.55 + - name: Test + run: make test cover + - name: Upload coverage + uses: actions/upload-artifact@v3 + with: + name: go-coverage + path: .build/coverage/go-coverage.txt + + check-coverage: + runs-on: ubuntu-latest + needs: + - test + steps: + - name: Check out repo and build scripts + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Download coverage + uses: actions/download-artifact@v3 + - name: Check coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index 0777c3a..c56f916 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ lint: test: mkdir -p $(COVERAGE_DIR) - go test -coverprofile=$(GO_COVER_FILE) + go test -coverprofile=$(GO_COVER_FILE) ./... cover: go tool cover -func=$(GO_COVER_FILE)