Skip to content

Commit d4266ef

Browse files
committed
feat: add workflow generator
1 parent 1042dee commit d4266ef

File tree

9 files changed

+823
-1
lines changed

9 files changed

+823
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ repos:
2525
- id: check-case-conflict
2626
- id: check-executables-have-shebangs
2727
- id: check-yaml
28+
exclude: 'adbc_drivers_dev/templates/.*\.yaml'
2829
- id: detect-private-key
2930
- id: end-of-file-fixer
3031
- id: mixed-line-ending

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
include adbc_drivers_dev/.env
1616
include adbc_drivers_dev/compose.yaml
1717
recursive-include adbc_drivers_dev/compose/ Dockerfile *.ld *.sh
18+
recursive-include adbc_drivers_dev/templates/ *.yaml
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<% if private %>
2+
# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved.
3+
<% else %>
4+
# Copyright (c) 2025 ADBC Drivers Contributors
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
<% endif %>
18+
19+
# This is a common workflow for performing basic PR checks like running
20+
# pre-commit.
21+
22+
name: Dev
23+
24+
on:
25+
pull_request: {}
26+
push:
27+
branches:
28+
- main
29+
30+
concurrency:
31+
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
32+
cancel-in-progress: true
33+
34+
defaults:
35+
run:
36+
shell: bash
37+
38+
permissions:
39+
contents: read
40+
41+
jobs:
42+
lint:
43+
name: "lint & pre-commit"
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- uses: actions/checkout@v6
48+
with:
49+
fetch-depth: 0
50+
persist-credentials: false
51+
52+
<% if lang.go %>
53+
- uses: actions/setup-go@v6
54+
with:
55+
cache-dependency-path: go/go.sum
56+
check-latest: true
57+
go-version-file: go/go.mod
58+
<% endif %>
59+
60+
- uses: actions/setup-python@v6
61+
with:
62+
python-version: "3.x"
63+
64+
- name: Install
65+
run: pip install pre-commit
66+
67+
- name: pre-commit (cache)
68+
uses: actions/cache@v4
69+
with:
70+
path: ~/.cache/pre-commit
71+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
72+
73+
- name: pre-commit
74+
run: |
75+
pre-commit run --all-files --color=always --show-diff-on-failure --verbose
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<% if private %>
2+
# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved.
3+
<% else %>
4+
# Copyright (c) 2025 ADBC Drivers Contributors
5+
<% endif %>
6+
#
7+
# This file has been modified from its original version, which is
8+
# under the Apache License:
9+
#
10+
# Licensed under the Apache License, Version 2.0 (the "License");
11+
# you may not use this file except in compliance with the License.
12+
# You may obtain a copy of the License at
13+
#
14+
# http://www.apache.org/licenses/LICENSE-2.0
15+
#
16+
# Unless required by applicable law or agreed to in writing, software
17+
# distributed under the License is distributed on an "AS IS" BASIS,
18+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
# See the License for the specific language governing permissions and
20+
# limitations under the License.
21+
22+
name: Issues Bot
23+
24+
on:
25+
issue_comment:
26+
types:
27+
- created
28+
- edited
29+
30+
jobs:
31+
issue_assign:
32+
name: "Assign issue"
33+
permissions:
34+
issues: write
35+
if: github.event.comment.body == 'take'
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
39+
with:
40+
github-token: ${{ secrets.GITHUB_TOKEN }}
41+
script: |
42+
github.rest.issues.addAssignees({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
issue_number: context.payload.issue.number,
46+
assignees: context.payload.comment.user.login
47+
});
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<% if private %>
2+
# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved.
3+
<% else %>
4+
# Copyright (c) 2025 ADBC Drivers Contributors
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
<% endif %>
18+
19+
# This is a common workflow for performing basic PR checks, like ensuring the
20+
# title format.
21+
22+
name: Dev PR
23+
24+
on:
25+
pull_request_target:
26+
types:
27+
- opened
28+
- edited
29+
- synchronize
30+
- ready_for_review
31+
- review_requested
32+
33+
concurrency:
34+
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
35+
cancel-in-progress: true
36+
37+
defaults:
38+
run:
39+
shell: bash
40+
41+
permissions:
42+
contents: read
43+
44+
jobs:
45+
pr_standard:
46+
name: "Check PR"
47+
runs-on: ubuntu-latest
48+
if: github.event_name == 'pull_request'
49+
50+
steps:
51+
<% if driver == "dev" %>
52+
- uses: actions/checkout@v6
53+
with:
54+
fetch-depth: 1
55+
persist-credentials: false
56+
57+
- name: Check PR title format
58+
env:
59+
PR_TITLE: ${{ github.event.pull_request.title }}
60+
run: |
61+
python adbc_drivers_dev/title_check.py $(pwd) "$PR_TITLE"
62+
<% else %>
63+
- name: Check PR title format
64+
env:
65+
PR_TITLE: ${{ github.event.pull_request.title }}
66+
run: |
67+
git clone --depth 1 https://github.com/adbc-drivers/dev
68+
python dev/adbc_drivers_dev/title_check.py $(pwd) "$PR_TITLE"
69+
<% endif %>
70+
71+
# TODO: assign milestone

0 commit comments

Comments
 (0)