From 557bbd4aa8e168fff47e84d57465671ef3bc6b34 Mon Sep 17 00:00:00 2001 From: Justin Tieri <37750742+jtieri@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:51:48 -0500 Subject: [PATCH] ci: configure additional ci jobs --- .codespellrc | 4 ++ .github/dependabot.yml | 14 ++++++ .github/mergify.yml | 15 ++++++ .github/workflows/codeql-analysis.yml | 61 +++++++++++++++++++++++ .github/workflows/markdown-link-check.yml | 11 ++++ .github/workflows/spell-check.yml | 24 +++++++++ .github/workflows/title-format.yml | 20 ++++++++ 7 files changed, 149 insertions(+) create mode 100644 .codespellrc create mode 100644 .github/dependabot.yml create mode 100644 .github/mergify.yml create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/markdown-link-check.yml create mode 100644 .github/workflows/spell-check.yml create mode 100644 .github/workflows/title-format.yml diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..d93e810d --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +skip = *.pulsar.go,*.pb.go,*.pb.gw.go,*.bin,*.sum,*.mod,*.git,*.json +ignore-words-list = usera,pres,crate +quiet-level = 3 \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..75b84468 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + # check dependencies in go.mod + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + # checks dependencies in github workflows + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 \ No newline at end of file diff --git a/.github/mergify.yml b/.github/mergify.yml new file mode 100644 index 00000000..47dfbbce --- /dev/null +++ b/.github/mergify.yml @@ -0,0 +1,15 @@ +# This mergify configuration is used for backporting only. This setup +# will backport a PR after being approved if it has the label 'backport'. +# Please see the comments below for configuring branches, labels, etc. +# +pull_request_rules: + - name: backport to maintained branches + conditions: + - label=backport # create a label in your project called backport + actions: + backport: + branches: # the list of branches the pull request should be copied to. + - main + assignees: # assign newly created backport PR to author + - "{{ author }}" + title: "`[BP: {{ destination_branch }} <- #{{ number }}]` {{ title }}" \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..bd9acccf --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,61 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +name: "CodeQL" + +on: + push: + branches: [ main ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ main ] + schedule: + - cron: '59 23 * * 5' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages. + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + # ✏️ If the Autobuild fails above, remove it and uncomment the following lines + # and modify them (or add more) to build your code. + + #- run: | + # make install + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 \ No newline at end of file diff --git a/.github/workflows/markdown-link-check.yml b/.github/workflows/markdown-link-check.yml new file mode 100644 index 00000000..3daf692b --- /dev/null +++ b/.github/workflows/markdown-link-check.yml @@ -0,0 +1,11 @@ +name: Markdown Link Check + +on: + pull_request: + +jobs: + link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 \ No newline at end of file diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 00000000..96ef19cc --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,24 @@ +name: Spell Check + +on: + pull_request: + +jobs: + spellcheck: + name: Run codespell + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install codespell + run: pip install codespell + + - name: Run codespell + run: codespell \ No newline at end of file diff --git a/.github/workflows/title-format.yml b/.github/workflows/title-format.yml new file mode 100644 index 00000000..b5e7d1a9 --- /dev/null +++ b/.github/workflows/title-format.yml @@ -0,0 +1,20 @@ +name: "Lint PR Title" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file