Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize workflow, add condecov and issue, stale robot #202

Merged
merged 1 commit into from
Aug 12, 2022
Merged
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
21 changes: 13 additions & 8 deletions .github/workflows/unit-test.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# limitations under the License.
#

# This is a workflow to help you test the unit case
# This is a workflow to help you test the unit case and show codecov

name: Unit Test
name: "build and codecov"

on:
push:
Expand All @@ -34,17 +34,22 @@ jobs:
golang:
- 1.16
steps:
- name: Set Up Go
uses: actions/setup-go@v2
- name: "set up go"
uses: actions/setup-go@v3
with:
go-version: 1.16

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: "Checkout ${{ github.ref }}"
- name: "checkout ${{ github.ref }}"
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Build
- name: "run go build"
run: go build -v ./...

- name: Test
run: go test -v ./...
- name: "run go test and out codecov"
run: go test -v ./... -race -coverprofile=coverage.out -covermode=atomic

- name: "upload coverage"
uses: codecov/codecov-action@v3
14 changes: 8 additions & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# This is a basic workflow to help you get started with Actions

name: Golang CI Lint
name: "golang ci lint"

# Controls when the workflow will run
on:
Expand All @@ -43,14 +43,16 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/setup-go@v3
name: Set Up Go
- name: "set up go"
uses: actions/setup-go@v3
with:
go-version: 1.16

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
name: "Checkout ${{ github.ref }}"
- name: Golang CI Lint
- name: "checkout ${{ github.ref }}"
uses: actions/checkout@v3

- name: "golang ci lint"
uses: golangci/[email protected]
with:
version: v1.44.2
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/issue-robot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: 'issue translator'
on:
issue_comment:
types: [created]
issues:
types: [opened]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: tomsun28/[email protected]
with:
# it is not necessary to decide whether you need to modify the issue header content
IS_MODIFY_TITLE: false
CUSTOM_BOT_NOTE: RoBot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿
8 changes: 4 additions & 4 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# This workflow will help me to auto set up label for pull request

name: "Pull Request Labeler"
name: "pull request labeler"
on:
- pull_request_target

Expand All @@ -34,9 +34,9 @@ jobs:
persist-credentials: false
submodules: true

- uses: actions/labeler@v4
name: "Labeler"
- name: "labeler"
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/actions/labeler/labeler.yml
sync-labels: true
sync-labels: true
48 changes: 48 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


# https://github.com/actions/stale
name: 'close the stale content'
on:
schedule:
- cron: '0 0 * * *'
permissions:
pull-requests: write
issues: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
#stale issues
days-before-issue-stale: 28
days-before-issue-close: 7
exempt-issue-labels: 'feature'
stale-issue-message: >
This issue has not been active for the past 4 weeks, so we will automatically close this issue after 7 days
close-issue-message: >
This issue has not been active for the past 5 weeks, so we are closing it now

#stale prs
days-before-pr-stale: 84
days-before-pr-close: 7
stale-pr-message: >
This PR has not been active for the past 12 weeks, so we will automatically close this issue after seven days
close-pr-message: >
This PR has not had any activity for the past 13 weeks, so we are now closing it down