Skip to content

Commit 4dcea73

Browse files
authored
chore: Add CI (#6)
1 parent 026f41b commit 4dcea73

File tree

8 files changed

+106
-18
lines changed

8 files changed

+106
-18
lines changed

.github/.kodiak.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version = 1
2+
3+
[approve]
4+
auto_approve_usernames = ["cq-bot"]
5+
6+
[merge.message]
7+
body = "pull_request_body"
8+
cut_body_after = "Use the following steps to ensure your PR is ready to be reviewed"
9+
cut_body_and_text = true
10+
cut_body_before = "<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->"
11+
title = "pull_request_title"
12+
13+
[merge]
14+
blocking_labels = ["wip", "no automerge"]
15+
notify_on_conflict = false

.github/renovate.json5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
extends: ["github>cloudquery/.github//.github/renovate-python-default.json5"],
3+
}

.github/workflows/lint.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,15 @@ on:
77
- main
88

99
jobs:
10-
build:
11-
10+
lint:
1211
runs-on: ubuntu-latest
13-
1412
steps:
15-
- uses: actions/checkout@v2
16-
13+
- uses: actions/checkout@v3
1714
- name: Set up Python
18-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v4
1916
with:
20-
python-version: 3.8
21-
22-
- name: Install Black
23-
run: pip install black
24-
25-
- name: Run Black
26-
run: black --check .
17+
python-version: "3.x"
18+
- name: Install dependencies
19+
run: pip install -r requirements.txt
20+
- name: Check formatting
21+
run: make fmt-check

.github/workflows/pr_title.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Validate PR title"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Please look up the latest version from
16+
# https://github.com/amannn/action-semantic-pull-request/releases
17+
- uses: amannn/action-semantic-pull-request@v5
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
# Configure which types are allowed.
22+
# Default: https://github.com/commitizen/conventional-commit-types
23+
types: |
24+
fix
25+
feat
26+
chore
27+
refactor
28+
test
29+
# Configure that a scope must always be provided.
30+
requireScope: false
31+
# Configure additional validation for the subject based on a regex.
32+
# This example ensures the subject starts with an uppercase character.
33+
subjectPattern: ^[A-Z].+$
34+
# If `subjectPattern` is configured, you can use this property to override
35+
# the default error message that is shown when the pattern doesn't match.
36+
# The variables `subject` and `title` can be used within the message.
37+
subjectPatternError: |
38+
The subject "{subject}" found in the pull request title "{title}"
39+
didn't match the configured pattern. Please ensure that the subject
40+
starts with an uppercase character.
41+
# For work-in-progress PRs you can typically use draft pull requests
42+
# from Github. However, private repositories on the free plan don't have
43+
# this option and therefore this action allows you to opt-in to using the
44+
# special "[WIP]" prefix to indicate this state. This will avoid the
45+
# validation of the PR title and the pull request checks remain pending.
46+
# Note that a second check will be reported if this is enabled.
47+
wip: true
48+
# When using "Squash and merge" on a PR with only one commit, GitHub
49+
# will suggest using that commit message instead of the PR title for the
50+
# merge commit, and it's easy to commit this by mistake. Enable this option
51+
# to also validate the commit message for one commit PRs.
52+
validateSingleCommit: false

.github/workflows/release_pr.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: release-please
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release-please:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: google-github-actions/release-please-action@v3
12+
id: release
13+
with:
14+
release-type: python
15+
package-name: plugin-sdk-python
16+
token: ${{ secrets.GH_CQ_BOT }}
17+
pull-request-title-pattern: "chore${scope}: Release${component} v${version}"
18+
# Should breaking changes before 1.0.0 produce minor bumps?
19+
bump-minor-pre-major: true
20+
# Should feat changes before 1.0.0 produce patch bumps instead of minor bumps?
21+
bump-patch-for-minor-pre-major: true

.github/workflows/unittests.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v3
16-
- uses: actions/setup-python@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
1718
with:
18-
python-version: "3.9"
19-
cache: "pip"
20-
cache-dependency-path: "./requirements.txt"
19+
python-version: "3.x"
2120
- name: Install dependencies
2221
run: pip install -r requirements.txt
2322
- name: Run tests

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ test:
22
pytest .
33

44
fmt:
5-
pip install -q black
65
black .
6+
7+
fmt-check:
8+
black --check .

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
black==23.7.0
12
grpcio==1.56.2
23
grpcio-tools==1.56.2
34
cloudquery-plugin-pb==0.0.14

0 commit comments

Comments
 (0)