From 016452b90c61f5f14b8c7a643a2d4616212bc757 Mon Sep 17 00:00:00 2001 From: Aleksandr Tolstikhin Date: Sat, 14 Dec 2024 01:41:59 +0700 Subject: [PATCH 1/2] Add workflows --- .gitea/ISSUE_TEMPLATE/bug_report.md | 18 +++++++ .../feature-request---enhancement.md | 17 ++++++ .gitea/ISSUE_TEMPLATE/question.md | 8 +++ .gitea/PULL_REQUEST_TEMPLATE.md | 9 ++++ .gitea/workflows/job_lint.yml | 29 ++++++++++ .gitea/workflows/job_test.yml | 34 ++++++++++++ .gitea/workflows/job_tests.yml | 53 +++++++++++++++++++ 7 files changed, 168 insertions(+) create mode 100644 .gitea/ISSUE_TEMPLATE/bug_report.md create mode 100644 .gitea/ISSUE_TEMPLATE/feature-request---enhancement.md create mode 100644 .gitea/ISSUE_TEMPLATE/question.md create mode 100644 .gitea/PULL_REQUEST_TEMPLATE.md create mode 100644 .gitea/workflows/job_lint.yml create mode 100644 .gitea/workflows/job_test.yml create mode 100644 .gitea/workflows/job_tests.yml diff --git a/.gitea/ISSUE_TEMPLATE/bug_report.md b/.gitea/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..a77fdfd --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,18 @@ +--- +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 new file mode 100644 index 0000000..c722ea6 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/feature-request---enhancement.md @@ -0,0 +1,17 @@ +--- +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 new file mode 100644 index 0000000..3d65c72 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/question.md @@ -0,0 +1,8 @@ +--- +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 new file mode 100644 index 0000000..cba3cbc --- /dev/null +++ b/.gitea/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +## 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/.gitea/workflows/job_lint.yml b/.gitea/workflows/job_lint.yml new file mode 100644 index 0000000..d97e747 --- /dev/null +++ b/.gitea/workflows/job_lint.yml @@ -0,0 +1,29 @@ +name: lint + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - master + - v3 + - v4 + +jobs: + lint: + 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: setup deps + run: go get -v ./... + - name: run lint + uses: https://github.com/golangci/golangci-lint-action@v6 + with: + version: 'latest' diff --git a/.gitea/workflows/job_test.yml b/.gitea/workflows/job_test.yml new file mode 100644 index 0000000..f68cbca --- /dev/null +++ b/.gitea/workflows/job_test.yml @@ -0,0 +1,34 @@ +name: test + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - master + - v3 + - v4 + push: + branches: + - master + - v3 + - v4 + +jobs: + test: + 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: setup deps + run: go get -v ./... + - name: run test + env: + INTEGRATION_TESTS: yes + run: go test -mod readonly -v ./... diff --git a/.gitea/workflows/job_tests.yml b/.gitea/workflows/job_tests.yml new file mode 100644 index 0000000..e8984f1 --- /dev/null +++ b/.gitea/workflows/job_tests.yml @@ -0,0 +1,53 @@ +name: test + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - master + - v3 + - v4 + push: + branches: + - master + - v3 + - v4 + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + filter: 'blob:none' + - name: checkout tests + uses: actions/checkout@v4 + with: + ref: master + filter: 'blob:none' + repository: unistack-org/micro-tests + path: micro-tests + - name: setup go + uses: actions/setup-go@v5 + with: + cache-dependency-path: "**/*.sum" + go-version: 'stable' + - name: setup go work + env: + GOWORK: /workspace/${{ github.repository_owner }}/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 + run: go get -v ./... + - name: run tests + env: + INTEGRATION_TESTS: yes + GOWORK: /workspace/${{ github.repository_owner }}/go.work + run: | + cd micro-tests + go test -mod readonly -v ./... || true -- 2.45.2 From 338a7bbc0f490bf33207b8eb92920bd667fce9ec Mon Sep 17 00:00:00 2001 From: Aleksandr Tolstikhin Date: Sat, 14 Dec 2024 01:43:55 +0700 Subject: [PATCH 2/2] Add golangci --- .golangci.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..2bb1c30 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,5 @@ +run: + concurrency: 8 + deadline: 5m + issues-exit-code: 1 + tests: true -- 2.45.2