Skip to content

Commit 69385a2

Browse files
lidavidmamoeba
andcommitted
chore: add common dev tooling
Co-authored-by: Bryce Mecum <petridish@gmail.com>
0 parents  commit 69385a2

40 files changed

+4208
-0
lines changed

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2025 ADBC Drivers Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# SCM syntax highlighting & preventing 3-way merges
16+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true

.github/CODEOWNERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2025 ADBC Drivers Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
* @lidavidm

.github/dependabot.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2025 ADBC Drivers Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
version: 2
16+
updates:
17+
- package-ecosystem: "github-actions"
18+
commit-message:
19+
prefix: "chore: "
20+
directory: "/"
21+
groups:
22+
actions:
23+
patterns:
24+
- "*"
25+
schedule:
26+
interval: "weekly"

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## What's Changed
2+
3+
Please fill in a description of the changes here.
4+
5+
**This contains breaking changes.** <!-- Remove this line if there are no breaking changes. -->
6+
7+
Closes #NNN.

.github/workflows/dev.yaml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copyright (c) 2025 ADBC Drivers Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This is a common workflow for performing basic PR checks:
16+
#
17+
# - Run pre-commit
18+
#
19+
# It is also planned to cover things like checking the PR title/description
20+
# format and ensuring issues and milestones are properly linked.
21+
22+
name: Dev
23+
24+
on:
25+
pull_request:
26+
types:
27+
- opened
28+
- edited
29+
- reopened
30+
- synchronize
31+
push:
32+
branches:
33+
- main
34+
workflow_call: {}
35+
36+
concurrency:
37+
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
38+
cancel-in-progress: true
39+
40+
defaults:
41+
run:
42+
shell: bash
43+
44+
permissions:
45+
contents: read
46+
47+
jobs:
48+
# Check the PR itself.
49+
pr_standard:
50+
name: "Check PR"
51+
runs-on: ubuntu-latest
52+
if: github.event_name == 'pull_request'
53+
54+
steps:
55+
- uses: actions/checkout@v5
56+
with:
57+
fetch-depth: 1
58+
persist-credentials: false
59+
60+
- name: Check PR title format
61+
if: github.repository == 'adbc-drivers/dev'
62+
env:
63+
PR_TITLE: ${{ github.event.pull_request.title }}
64+
run: |
65+
python adbc_drivers_dev/title_check.py $(pwd) "$PR_TITLE"
66+
67+
- name: Check PR title format
68+
if: github.repository != 'adbc-drivers/dev'
69+
env:
70+
PR_TITLE: ${{ github.event.pull_request.title }}
71+
run: |
72+
git clone --depth 1 git@github.com:adbc-drivers/dev
73+
python dev/adbc_drivers_dev/title_check.py $(pwd) "$PR_TITLE"
74+
75+
lint:
76+
name: "lint & pre-commit"
77+
runs-on: ubuntu-latest
78+
if: "github.event.action != 'edited'"
79+
80+
steps:
81+
- uses: actions/checkout@v5
82+
with:
83+
fetch-depth: 0
84+
persist-credentials: false
85+
86+
- uses: actions/setup-go@v6
87+
with:
88+
check-latest: true
89+
go-version: "stable"
90+
91+
- uses: actions/setup-python@v6
92+
with:
93+
python-version: "3.x"
94+
95+
- name: Install
96+
run: pip install pre-commit
97+
98+
- name: pre-commit (cache)
99+
uses: actions/cache@v4
100+
with:
101+
path: ~/.cache/pre-commit
102+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
103+
104+
- name: pre-commit
105+
run: |
106+
pre-commit run --all-files --color=always --show-diff-on-failure --verbose

.github/workflows/dev_issues.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) 2025 ADBC Drivers Contributors
2+
#
3+
# This file has been modified from its original version, which is
4+
# under the Apache License:
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one
7+
# or more contributor license agreements. See the NOTICE file
8+
# distributed with this work for additional information
9+
# regarding copyright ownership. The ASF licenses this file
10+
# to you under the Apache License, Version 2.0 (the
11+
# "License"); you may not use this file except in compliance
12+
# with the License. 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,
17+
# software distributed under the License is distributed on an
18+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19+
# KIND, either express or implied. See the License for the
20+
# specific language governing permissions and limitations
21+
# under the License.
22+
23+
name: Issues Bot
24+
25+
on:
26+
issue_comment:
27+
types:
28+
- created
29+
- edited
30+
workflow_call: {}
31+
32+
jobs:
33+
issue_assign:
34+
name: "Assign issue"
35+
permissions:
36+
issues: write
37+
if: github.event.comment.body == 'take'
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
41+
with:
42+
github-token: ${{ secrets.GITHUB_TOKEN }}
43+
script: |
44+
github.rest.issues.addAssignees({
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
issue_number: context.payload.issue.number,
48+
assignees: context.payload.comment.user.login
49+
});
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Copyright (c) 2025 ADBC Drivers Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Re-build and push the docker containers we use.
16+
17+
name: Docker Compose Build
18+
19+
on:
20+
schedule:
21+
- cron: "0 0 * * *"
22+
workflow_dispatch:
23+
inputs:
24+
push:
25+
description: "Push to ghcr.io"
26+
required: true
27+
type: boolean
28+
default: false
29+
30+
concurrency:
31+
group: ${{ github.repository }}-${{ github.workflow }}
32+
cancel-in-progress: true
33+
34+
defaults:
35+
run:
36+
shell: bash
37+
38+
jobs:
39+
build:
40+
name: "Build & Push"
41+
runs-on: ubuntu-latest
42+
if: github.event_name != 'schedule' || github.repository == 'adbc-drivers/dev'
43+
permissions:
44+
contents: read
45+
packages: write
46+
47+
steps:
48+
- uses: actions/checkout@v5
49+
with:
50+
persist-credentials: false
51+
52+
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
53+
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
54+
55+
- name: Log in to ghcr.io
56+
run: |
57+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
58+
59+
- name: Build
60+
if: github.event_name != 'schedule' && !inputs.push
61+
run: |
62+
cd adbc_drivers_dev
63+
docker compose build
64+
65+
- name: Push
66+
if: github.event_name == 'schedule' || inputs.push
67+
run: |
68+
cd adbc_drivers_dev
69+
docker compose build --push

.github/workflows/release.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Copyright (c) 2025 ADBC Drivers Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This is a common workflow for releasing Go drivers. It should be run
16+
# against a Go-style tag for a subdirectory (e.g. go/redshift/v1.0.0) and
17+
# should be sequenced after test.yaml.
18+
19+
name: Release
20+
21+
on:
22+
workflow_call:
23+
inputs:
24+
dry_run:
25+
required: false
26+
default: false
27+
type: boolean
28+
subdir:
29+
required: false
30+
type: string
31+
tag:
32+
required: false
33+
default: ""
34+
type: string
35+
36+
concurrency:
37+
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
38+
cancel-in-progress: true
39+
40+
defaults:
41+
run:
42+
shell: bash
43+
44+
# Unfortunately, creating releases needs contents: write which is rather
45+
# broad. https://github.com/orgs/community/discussions/68252
46+
permissions:
47+
contents: write
48+
49+
jobs:
50+
build:
51+
name: "Release"
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- uses: actions/checkout@v5
56+
with:
57+
fetch-depth: 0
58+
persist-credentials: false
59+
60+
- uses: prefix-dev/setup-pixi@28eb668aafebd9dede9d97c4ba1cd9989a4d0004 # v0.9.2
61+
with:
62+
pixi-version: v0.50.2
63+
run-install: false
64+
65+
- uses: actions/download-artifact@v5
66+
with:
67+
name: "all-packages"
68+
path: "~/packages"
69+
70+
- uses: actions/download-artifact@v5
71+
with:
72+
name: "docs"
73+
path: "~/packages"
74+
75+
- name: Release
76+
if: "!inputs.dry_run"
77+
env:
78+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
working-directory: ${{ inputs.subdir }}
80+
run: |
81+
ref=${{ github.ref }}
82+
tag=${ref#"refs/tags/"}
83+
84+
pixi run release $(pwd) $tag
85+
gh release upload $tag $(find ~/packages -name '*.tar.gz') $(find ~/packages -name 'manifest.yaml') $(find ~/packages -name '*.md')
86+
87+
- name: Release (dry-run)
88+
if: inputs.dry_run
89+
env:
90+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
working-directory: ${{ inputs.subdir }}
92+
run: |
93+
git tag ${{ inputs.tag }}
94+
tag=${{ inputs.tag }}
95+
96+
pixi run release --dry-run $(pwd) $tag
97+
echo gh release upload $tag $(find ~/packages -name '*.tar.gz') $(find ~/packages -name 'manifest.yaml') $(find ~/packages -name '*.md')

0 commit comments

Comments
 (0)