Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: Add CI
  • Loading branch information
erezrokah committed Jul 28, 2023
commit 25bd755f422e06f3f8e1ef944736e598eee8c7e5
15 changes: 15 additions & 0 deletions .github/.kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version = 1

[approve]
auto_approve_usernames = ["cq-bot"]

[merge.message]
body = "pull_request_body"
cut_body_after = "Use the following steps to ensure your PR is ready to be reviewed"
cut_body_and_text = true
cut_body_before = "<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->"
title = "pull_request_title"

[merge]
blocking_labels = ["wip", "no automerge"]
notify_on_conflict = false
3 changes: 3 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
extends: ["github>cloudquery/.github//.github/renovate-python-default.json5"],
}
21 changes: 8 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ on:
- main

jobs:
build:

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install Black
run: pip install black

- name: Run Black
run: black --check .
python-version: "3.x"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Check formatting
run: make fmt-check
52 changes: 52 additions & 0 deletions .github/workflows/pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Validate PR title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
# Please look up the latest version from
# https://github.com/amannn/action-semantic-pull-request/releases
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed.
# Default: https://github.com/commitizen/conventional-commit-types
types: |
fix
feat
chore
refactor
test
# Configure that a scope must always be provided.
requireScope: false
# Configure additional validation for the subject based on a regex.
# This example ensures the subject starts with an uppercase character.
subjectPattern: ^[A-Z].+$
# If `subjectPattern` is configured, you can use this property to override
# the default error message that is shown when the pattern doesn't match.
# The variables `subject` and `title` can be used within the message.
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
starts with an uppercase character.
# For work-in-progress PRs you can typically use draft pull requests
# from Github. However, private repositories on the free plan don't have
# this option and therefore this action allows you to opt-in to using the
# special "[WIP]" prefix to indicate this state. This will avoid the
# validation of the PR title and the pull request checks remain pending.
# Note that a second check will be reported if this is enabled.
wip: true
# When using "Squash and merge" on a PR with only one commit, GitHub
# will suggest using that commit message instead of the PR title for the
# merge commit, and it's easy to commit this by mistake. Enable this option
# to also validate the commit message for one commit PRs.
validateSingleCommit: false
21 changes: 21 additions & 0 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release-please
on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: python
package-name: plugin-sdk-python
token: ${{ secrets.GH_CQ_BOT }}
pull-request-title-pattern: "chore${scope}: Release${component} v${version}"
# Should breaking changes before 1.0.0 produce minor bumps?
bump-minor-pre-major: true
# Should feat changes before 1.0.0 produce patch bumps instead of minor bumps?
bump-patch-for-minor-pre-major: true
7 changes: 3 additions & 4 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "./requirements.txt"
python-version: "3.x"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ test:
pytest .

fmt:
pip install -q black
black .

fmt-check:
black --check .
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
black==23.7.0
grpcio==1.56.2
grpcio-tools==1.56.2
cloudquery-plugin-pb==0.0.14
Expand Down