From b9d23729fbc9c52a8a36451d7a9e727ed89b2bdc Mon Sep 17 00:00:00 2001 From: hoangdv2429 Date: Thu, 21 Mar 2024 16:53:19 +0700 Subject: [PATCH] update workflows and template --- .github/pull_request_template.md | 5 ++++ .github/workflows/codeql.yml | 41 +++++++++++++++++++++++++++++ .github/workflows/golangci_lint.yml | 23 ++++++++++++++++ .github/workflows/markdown_lint.yml | 19 +++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/golangci_lint.yml create mode 100644 .github/workflows/markdown_lint.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 30357ce0..1d02bc64 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,6 +4,11 @@ --- +Closes #XXX + +**All** items are required. Please add a note to the item if the item is not applicable and +please add links to any relevant follow-up issues. + For Author: - [ ] Targeted PR against correct branch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..12226a0f --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,41 @@ +name: "CodeQL" + +on: + pull_request: + paths: + - "**.go" + push: + # The branches below must be a subset of the branches above + branches: + - main + - release/** + paths: + - "**.go" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: "1.22" + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: "go" + queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality + + - name: Build + run: make build + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/golangci_lint.yml b/.github/workflows/golangci_lint.yml new file mode 100644 index 00000000..10284610 --- /dev/null +++ b/.github/workflows/golangci_lint.yml @@ -0,0 +1,23 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - main + pull_request: + +jobs: + golangci: + name: golangci-lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + - name: golangci-lint + uses: golangci/golangci-lint-action@v4.0.0 + with: + version: v1.56.2 + skip-cache: true diff --git a/.github/workflows/markdown_lint.yml b/.github/workflows/markdown_lint.yml new file mode 100644 index 00000000..2f1219c6 --- /dev/null +++ b/.github/workflows/markdown_lint.yml @@ -0,0 +1,19 @@ +name: markdown-lint +on: + push: + tags: + - v* + branches: + - main + pull_request: + +jobs: + markdownlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: markdownlint-cli + uses: nosborn/github-action-markdown-cli@v3.2.0 + with: + files: ./ + config_file: .markdownlint.yaml \ No newline at end of file