diff --git a/.gitea/ISSUE_TEMPLATE/bug_report.md b/.gitea/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index a77fdfd..0000000 --- a/.gitea/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: Bug report -about: For reporting bugs in micro -title: "[BUG]" -labels: '' -assignees: '' - ---- - -**Describe the bug** - -1. What are you trying to do? -2. What did you expect to happen? -3. What happens instead? - -**How to reproduce the bug:** - -If possible, please include a minimal code snippet here. diff --git a/.gitea/ISSUE_TEMPLATE/feature-request---enhancement.md b/.gitea/ISSUE_TEMPLATE/feature-request---enhancement.md deleted file mode 100644 index c722ea6..0000000 --- a/.gitea/ISSUE_TEMPLATE/feature-request---enhancement.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request / Enhancement -about: If you have a need not served by micro -title: "[FEATURE]" -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Additional context** -Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/question.md b/.gitea/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 3d65c72..0000000 --- a/.gitea/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: Question -about: Ask a question about micro -title: '' -labels: '' -assignees: '' - ---- \ No newline at end of file diff --git a/.gitea/PULL_REQUEST_TEMPLATE.md b/.gitea/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index cba3cbc..0000000 --- a/.gitea/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,9 +0,0 @@ -## Pull Request template -Please, go through these steps before clicking submit on this PR. - -1. Give a descriptive title to your PR. -2. Provide a description of your changes. -3. Make sure you have some relevant tests. -4. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if applicable). - -**PLEASE REMOVE THIS TEMPLATE BEFORE SUBMITTING** diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1899438..a77fdfd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: For reporting bugs in go-micro +about: For reporting bugs in micro title: "[BUG]" labels: '' assignees: '' @@ -16,9 +16,3 @@ assignees: '' **How to reproduce the bug:** If possible, please include a minimal code snippet here. - -**Environment:** -Go Version: please paste `go version` output here -``` -please paste `go env` output here -``` diff --git a/.github/ISSUE_TEMPLATE/feature-request---enhancement.md b/.github/ISSUE_TEMPLATE/feature-request---enhancement.md index 459817f..c722ea6 100644 --- a/.github/ISSUE_TEMPLATE/feature-request---enhancement.md +++ b/.github/ISSUE_TEMPLATE/feature-request---enhancement.md @@ -1,6 +1,6 @@ --- name: Feature request / Enhancement -about: If you have a need not served by go-micro +about: If you have a need not served by micro title: "[FEATURE]" labels: '' assignees: '' @@ -14,4 +14,4 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate A clear and concise description of what you want to happen. **Additional context** -Add any other context or screenshots about the feature request here. +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 1daf48b..3d65c72 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -1,14 +1,8 @@ --- name: Question -about: Ask a question about go-micro +about: Ask a question about micro title: '' labels: '' assignees: '' ---- - -Before asking, please check if your question has already been answered: - -1. Check the documentation - https://micro.mu/docs/ -2. Check the examples and plugins - https://github.com/micro/examples & https://github.com/micro/go-plugins -3. Search existing issues +--- \ No newline at end of file diff --git a/.gitea/autoapprove.yml b/.github/autoapprove.yml similarity index 100% rename from .gitea/autoapprove.yml rename to .github/autoapprove.yml diff --git a/.github/workflows/job_coverage.yml b/.github/workflows/job_coverage.yml new file mode 100644 index 0000000..4317367 --- /dev/null +++ b/.github/workflows/job_coverage.yml @@ -0,0 +1,54 @@ +name: coverage + +on: + push: + branches: [ main, v3, v4 ] + paths-ignore: + - '.github/**' + - '.gitea/**' + pull_request: + branches: [ main, v3, v4 ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + filter: 'blob:none' + + - name: setup go + uses: actions/setup-go@v5 + with: + cache-dependency-path: "**/*.sum" + go-version: 'stable' + + - name: test coverage + run: | + go test -v -cover ./... -covermode=count -coverprofile coverage.out -coverpkg ./... + go tool cover -func coverage.out -o coverage.out + + - name: coverage badge + uses: tj-actions/coverage-badge-go@v2 + with: + green: 80 + filename: coverage.out + + - uses: stefanzweifel/git-auto-commit-action@v4 + name: autocommit + with: + commit_message: Apply Code Coverage Badge + skip_fetch: false + skip_checkout: false + file_pattern: ./README.md + + - name: push + if: steps.auto-commit-action.outputs.changes_detected == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ github.token }} + branch: ${{ github.ref }} diff --git a/.gitea/workflows/job_lint.yml b/.github/workflows/job_lint.yml similarity index 77% rename from .gitea/workflows/job_lint.yml rename to .github/workflows/job_lint.yml index d97e747..fdba6d8 100644 --- a/.gitea/workflows/job_lint.yml +++ b/.github/workflows/job_lint.yml @@ -3,10 +3,10 @@ name: lint on: pull_request: types: [opened, reopened, synchronize] - branches: - - master - - v3 - - v4 + branches: [ master, v3, v4 ] + paths-ignore: + - '.github/**' + - '.gitea/**' jobs: lint: @@ -24,6 +24,6 @@ jobs: - name: setup deps run: go get -v ./... - name: run lint - uses: https://github.com/golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v6 with: version: 'latest' diff --git a/.github/workflows/job_sync.yml b/.github/workflows/job_sync.yml new file mode 100644 index 0000000..7f4af85 --- /dev/null +++ b/.github/workflows/job_sync.yml @@ -0,0 +1,60 @@ +name: sync + +on: + schedule: + - cron: '*/5 * * * *' + push: + branches: [ master, v3, v4 ] + paths-ignore: + - '.github/**' + - '.gitea/**' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + sync: + if: env.GITHUB_ACTION == 0 + runs-on: ubuntu-latest + steps: + - name: init + run: | + git config --global user.email "vtolstov " + git config --global user.name "github-actions[bot]" + echo "machine git.unistack.org login vtolstov password ${{ secrets.TOKEN_GITEA }}" | tee -a /root/.netrc + echo "machine github.com login vtolstov password ${{ secrets.TOKEN_GITHUB }}" | tee -a /root/.netrc + + - name: sync master + run: | + git clone --depth=10 --branch master --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + cd repo + git remote add --no-tags --fetch --track master upstream https://github.com/${GITHUB_REPOSITORY} + git pull --rebase upstream master + git push upstream master --progress + git merge --allow-unrelated-histories "upstream/master" + git push origin master --progress + cd ../ + rm -rf repo + + - name: sync v3 + run: | + git clone --depth=10 --branch v3 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + cd repo + git remote add --no-tags --fetch --track v3 upstream https://github.com/${GITHUB_REPOSITORY} + git pull --rebase upstream v3 + git push upstream v3 + git merge --allow-unrelated-histories "upstream/v3" + git push origin v3 --progress + cd ../ + rm -rf repo + + - name: sync v4 + run: | + git clone --depth=10 --branch v4 --single-branch ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} repo + cd repo + git remote add --no-tags --fetch --track v4 upstream https://github.com/${GITHUB_REPOSITORY} + git pull --rebase upstream v4 + git push upstream v4 + git merge --allow-unrelated-histories "upstream/v4" + git push origin v4 --progress + cd ../ + rm -rf repo diff --git a/.gitea/workflows/job_test.yml b/.github/workflows/job_test.yml similarity index 80% rename from .gitea/workflows/job_test.yml rename to .github/workflows/job_test.yml index f68cbca..59a95ae 100644 --- a/.gitea/workflows/job_test.yml +++ b/.github/workflows/job_test.yml @@ -3,15 +3,12 @@ name: test on: pull_request: types: [opened, reopened, synchronize] - branches: - - master - - v3 - - v4 + branches: [ master, v3, v4 ] push: - branches: - - master - - v3 - - v4 + branches: [ master, v3, v4 ] + paths-ignore: + - '.github/**' + - '.gitea/**' jobs: test: diff --git a/.gitea/workflows/job_tests.yml b/.github/workflows/job_tests.yml similarity index 75% rename from .gitea/workflows/job_tests.yml rename to .github/workflows/job_tests.yml index e8984f1..9af2291 100644 --- a/.gitea/workflows/job_tests.yml +++ b/.github/workflows/job_tests.yml @@ -3,15 +3,12 @@ name: test on: pull_request: types: [opened, reopened, synchronize] - branches: - - master - - v3 - - v4 + branches: [ master, v3, v4 ] push: - branches: - - master - - v3 - - v4 + branches: [ master, v3, v4 ] + paths-ignore: + - '.github/**' + - '.gitea/**' jobs: test: @@ -35,19 +32,19 @@ jobs: go-version: 'stable' - name: setup go work env: - GOWORK: /workspace/${{ github.repository_owner }}/go.work + GOWORK: ${{ github.workspace }}/go.work run: | go work init go work use . go work use micro-tests - name: setup deps env: - GOWORK: /workspace/${{ github.repository_owner }}/go.work + GOWORK: ${{ github.workspace }}/go.work run: go get -v ./... - name: run tests env: INTEGRATION_TESTS: yes - GOWORK: /workspace/${{ github.repository_owner }}/go.work + GOWORK: ${{ github.workspace }}/go.work run: | cd micro-tests go test -mod readonly -v ./... || true diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..c6a7985 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,5 @@ +run: + concurrency: 8 + timeout: 5m + issues-exit-code: 1 + tests: true