From df1c3b40df3022833feb2f3266de79f7d2692994 Mon Sep 17 00:00:00 2001 From: amdahliu Date: Wed, 18 Oct 2023 16:06:39 +0800 Subject: [PATCH] add README.md --- .github/workflows/cla.yml | 32 +++++++++++++++++++++ .github/workflows/prc.yml | 60 +++++++++++++++++++++++++++++++++++++++ README.md | 11 +++++++ 3 files changed, 103 insertions(+) create mode 100644 .github/workflows/cla.yml create mode 100644 .github/workflows/prc.yml diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml new file mode 100644 index 0000000..e842c6c --- /dev/null +++ b/.github/workflows/cla.yml @@ -0,0 +1,32 @@ +name: "CLA Assistant" +on: + issue_comment: + types: [created] + pull_request_target: + types: [opened, synchronize, reopened] + +# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings +permissions: + actions: write + contents: write + pull-requests: write + statuses: write + +jobs: + CLAAssistant: + runs-on: ubuntu-latest + steps: + - name: "CLA Assistant" + if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' + uses: contributor-assistant/github-action@v2.3.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_DATABASE_ACCESS_TOKEN }} + with: + remote-organization-name: trpc-group + remote-repository-name: cla-database + path-to-signatures: 'signatures/${{ github.event.repository.name }}-${{ github.repository_id }}/cla.json' + path-to-document: 'https://github.com/trpc-group/cla-database/blob/main/Tencent-Contributor-License-Agreement.md' + # branch should not be protected + branch: 'main' + allowlist: bot* \ No newline at end of file diff --git a/.github/workflows/prc.yml b/.github/workflows/prc.yml new file mode 100644 index 0000000..3451a35 --- /dev/null +++ b/.github/workflows/prc.yml @@ -0,0 +1,60 @@ +name: Pull Request Check +on: + pull_request: + push: + workflow_dispatch: +permissions: + contents: read + pull-requests: read # Use with `only-new-issues` option. +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: 1.19 + - name: Build + run: go build -v ./... + - name: Test + run: go test -v -coverprofile=coverage.out ./... + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + files: coverage.out + flags: unittests + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: 1.19 + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + only-new-issues: true + skip-cache: true # To prevent occasional failure of this action. + typos: + name: typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: typos + uses: crate-ci/typos@master + go-apidiff: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-go@v4 + with: + go-version: 1.19 + - uses: joelanford/go-apidiff@main diff --git a/README.md b/README.md index e69de29..29a379d 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,11 @@ +# Utils + +[![Go Reference](https://pkg.go.dev/badge/github.com/trpc-ecosystem/go-utils.svg)](https://pkg.go.dev/github.com/trpc-ecosystem/go-utils) +[![Go Report Card](https://goreportcard.com/badge/trpc.group/trpc-go/trpc-utils)](https://goreportcard.com/report/trpc.group/trpc-go/trpc-utils) +[![LICENSE](https://img.shields.io/badge/license-Apache--2.0-green.svg)](https://github.com/trpc-ecosystem/go-utils/blob/main/LICENSE) +[![Releases](https://img.shields.io/github/release/trpc-ecosystem/go-utils.svg?style=flat-square)](https://github.com/trpc-ecosystem/go-utils/releases) +[![Tests](https://github.com/trpc-ecosystem/go-utils/actions/workflows/prc.yml/badge.svg)](https://github.com/trpc-ecosystem/go-utils/actions/workflows/prc.yml) +[![Coverage](https://codecov.io/gh/trpc-ecosystem/go-utils/branch/main/graph/badge.svg)](https://app.codecov.io/gh/trpc-ecosystem/go-utils/tree/main) + +Utils provides a set of utility functions for common tasks in Golang programming. +