Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -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*
60 changes: 60 additions & 0 deletions .github/workflows/prc.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.