From 0bc9b0c26939fb3feb8041e7d5de27062f4a74e0 Mon Sep 17 00:00:00 2001 From: Viacheslav Gonkivskyi Date: Fri, 24 Mar 2023 11:46:26 +0100 Subject: [PATCH 1/2] feat(ci): add ci actions --- .github/ISSUE_TEMPLATE/bug-report.yml | 82 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/feature-request.yml | 16 +++++ .github/workflows/go-ci.yml | 82 ++++++++++++++++++++-- .github/workflows/labels.yml | 19 +++++ 5 files changed, 193 insertions(+), 7 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml create mode 100644 .github/workflows/labels.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 00000000..074065ad --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,82 @@ +name: Bug Report +description: File a bug report to inform the community on your awesome finding! +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thank you for filling out this bug report! + - type: input + id: version + attributes: + label: Celestia Go Header version + description: > + use 'celestia version' or 'git rev-parse --verify HEAD' if installed + from source code + validations: + required: true + - type: markdown + attributes: + value: | + Environment + - type: input + id: os + attributes: + label: OS + description: e.g. from /etc/os-release + validations: + required: true + - type: textarea + id: tools + attributes: + label: Install tools + description: e.g. docker, makefiles, etc. + - type: textarea + id: others + attributes: + label: Others + description: > + e.g. flag options, celestia config file changes, resources + limitation(like cpu, ram limit, swap etc.) + - type: textarea + id: steps + attributes: + label: Steps to reproduce it + description: What steps have you made to reproduce it? + placeholder: Tell us what you see! + validations: + required: true + - type: textarea + id: expectation + attributes: + label: Expected result + description: What do you expect to happen as a final result? + placeholder: Let us know what is expected + validations: + required: true + - type: textarea + id: actual + attributes: + label: Actual result + description: What do you see happened instead as a final result? + placeholder: > + This is the crucial part in detecting the root cause of the issue + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: > + Please copy and paste any relevant log(max 20 lines) output. This will + be automatically formatted into code, so no need for backticks. Or paste + gists, pastebins links here + render: Shell + - type: textarea + id: misc + attributes: + label: Notes + description: Is there anything else we need to know? + placeholder: > + Maybe, you have other ways to repro or what side effects there are if + changing steps diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..0086358d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 00000000..91c680c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,16 @@ +name: Feature Request +description: > + Request a new feature to inform the community on what will be beneficial for + the project! +title: "[Feature Request]: " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thank you for taking your time and creating a new feature request! + - type: textarea + id: ideas + attributes: + label: Implementation ideas + description: What ideas do you have on how to implement this? diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index 4b8a0233..527fd382 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -1,13 +1,81 @@ -name: go-header CI +name: Go CI + on: - push: - tags: - - v* - branches: - - main - pull_request: + workflow_call: + +env: + GO_VERSION: 1.19 + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - name: golangci-lint + uses: golangci/golangci-lint-action@v3.4.0 + with: + version: v1.49.0 + + go_mod_tidy_check: + name: Go Mod Tidy Check + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - run: go mod tidy + + - name: check for diff + run: git diff --exit-code + + test_coverage: + name: Unit Tests Coverage + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: set up go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Test & Coverage + run: make cover + - uses: codecov/codecov-action@v3.1.1 + with: + file: ./coverage.txt + + unit_race_test: + name: Run Unit Tests with Race Detector + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: set up go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - name: execute test run + run: make test-unit-race + build: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 00000000..38c9d282 --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,19 @@ +name: Required Labels + +on: + pull_request: + types: [opened, labeled, unlabeled, synchronize] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: mheap/github-action-required-labels@v3 + with: + mode: minimum + count: 1 + labels: "kind:fix, kind:misc, kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci, kind:chore" # yamllint disable-line rule:line-length From f4ec5dec21a1e383ce1acf8dad057f14434165bb Mon Sep 17 00:00:00 2001 From: Viacheslav Gonkivskyi Date: Fri, 24 Mar 2023 14:27:40 +0100 Subject: [PATCH 2/2] chore: improvements --- .github/ISSUE_TEMPLATE/bug-report.yml | 82 ---------------------- .github/ISSUE_TEMPLATE/config.yml | 1 - .github/ISSUE_TEMPLATE/feature-request.yml | 16 ----- .github/workflows/go-ci.yml | 57 +++------------ .github/workflows/labels.yml | 2 +- 5 files changed, 11 insertions(+), 147 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml deleted file mode 100644 index 074065ad..00000000 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Bug Report -description: File a bug report to inform the community on your awesome finding! -labels: ["bug"] -body: - - type: markdown - attributes: - value: | - Thank you for filling out this bug report! - - type: input - id: version - attributes: - label: Celestia Go Header version - description: > - use 'celestia version' or 'git rev-parse --verify HEAD' if installed - from source code - validations: - required: true - - type: markdown - attributes: - value: | - Environment - - type: input - id: os - attributes: - label: OS - description: e.g. from /etc/os-release - validations: - required: true - - type: textarea - id: tools - attributes: - label: Install tools - description: e.g. docker, makefiles, etc. - - type: textarea - id: others - attributes: - label: Others - description: > - e.g. flag options, celestia config file changes, resources - limitation(like cpu, ram limit, swap etc.) - - type: textarea - id: steps - attributes: - label: Steps to reproduce it - description: What steps have you made to reproduce it? - placeholder: Tell us what you see! - validations: - required: true - - type: textarea - id: expectation - attributes: - label: Expected result - description: What do you expect to happen as a final result? - placeholder: Let us know what is expected - validations: - required: true - - type: textarea - id: actual - attributes: - label: Actual result - description: What do you see happened instead as a final result? - placeholder: > - This is the crucial part in detecting the root cause of the issue - validations: - required: true - - type: textarea - id: logs - attributes: - label: Relevant log output - description: > - Please copy and paste any relevant log(max 20 lines) output. This will - be automatically formatted into code, so no need for backticks. Or paste - gists, pastebins links here - render: Shell - - type: textarea - id: misc - attributes: - label: Notes - description: Is there anything else we need to know? - placeholder: > - Maybe, you have other ways to repro or what side effects there are if - changing steps diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 0086358d..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml deleted file mode 100644 index 91c680c6..00000000 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Feature Request -description: > - Request a new feature to inform the community on what will be beneficial for - the project! -title: "[Feature Request]: " -labels: ["enhancement"] -body: - - type: markdown - attributes: - value: | - Thank you for taking your time and creating a new feature request! - - type: textarea - id: ideas - attributes: - label: Implementation ideas - description: What ideas do you have on how to implement this? diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index 527fd382..9358f2c4 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -1,15 +1,11 @@ -name: Go CI - +name: go-header CI on: - workflow_call: - -env: - GO_VERSION: 1.19 - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - + push: + tags: + - v* + branches: + - main + pull_request: jobs: lint: name: Lint @@ -20,7 +16,7 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: 1.20 - name: golangci-lint uses: golangci/golangci-lint-action@v3.4.0 @@ -36,46 +32,13 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: ${{ env.GO_VERSION }} + go-version: 1.20 - run: go mod tidy - name: check for diff - run: git diff --exit-code - - test_coverage: - name: Unit Tests Coverage - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: set up go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Test & Coverage - run: make cover - - uses: codecov/codecov-action@v3.1.1 - with: - file: ./coverage.txt - - unit_race_test: - name: Run Unit Tests with Race Detector - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: set up go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} + run: git diff --exit-code - - name: execute test run - run: make test-unit-race - build: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 38c9d282..6d1d1cb2 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -16,4 +16,4 @@ jobs: with: mode: minimum count: 1 - labels: "kind:fix, kind:misc, kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci, kind:chore" # yamllint disable-line rule:line-length + labels: "kind:fix, kind:misc, kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci, kind:chore, kind:perf" # yamllint disable-line rule:line-length