Skip to content

Commit ddeb3db

Browse files
committed
chore: Add github actions workflow files.
1 parent 7b69eb6 commit ddeb3db

File tree

9 files changed

+279
-9
lines changed

9 files changed

+279
-9
lines changed

.github/auto-label.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2024 Google LLC
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+
# https://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+
enabled: false

.github/header-checker-lint.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 Google LLC
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+
# https://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+
allowedCopyrightHolders:
16+
- 'Google LLC'
17+
allowedLicenses:
18+
- 'Apache-2.0'
19+
sourceFileExtensions:
20+
- 'py'
21+
- 'yaml'
22+
- 'yml'

.github/labels.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright 2024 Google LLC
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+
- name: duplicate
16+
color: ededed
17+
description: ""
18+
19+
- name: 'type: bug'
20+
color: db4437
21+
description: Error or flaw in code with unintended results or allowing sub-optimal
22+
usage patterns.
23+
- name: 'type: cleanup'
24+
color: c5def5
25+
description: An internal cleanup or hygiene concern.
26+
- name: 'type: docs'
27+
color: 0000A0
28+
description: Improvement to the documentation for an API.
29+
- name: 'type: feature request'
30+
color: c5def5
31+
description: ‘Nice-to-have’ improvement, new feature or different behavior or design.
32+
- name: 'type: process'
33+
color: c5def5
34+
description: A process-related concern. May include testing, release, or the like.
35+
- name: 'type: question'
36+
color: c5def5
37+
description: Request for information or clarification.
38+
39+
- name: 'priority: p0'
40+
color: b60205
41+
description: Highest priority. Critical issue. P0 implies highest priority.
42+
- name: 'priority: p1'
43+
color: ffa03e
44+
description: Important issue which blocks shipping the next release. Will be fixed
45+
prior to next release.
46+
- name: 'priority: p2'
47+
color: fef2c0
48+
description: Moderately-important priority. Fix may not be included in next release.
49+
- name: 'priority: p3'
50+
color: ffffc7
51+
description: Desirable enhancement or fix. May not be included in next release.
52+
53+
- name: do not merge
54+
color: d93f0b
55+
description: Indicates a pull request not ready for merge, due to either quality
56+
or timing.
57+
58+
- name: 'autorelease: pending'
59+
color: ededed
60+
description: Release please needs to do its work on this.
61+
- name: 'autorelease: triggered'
62+
color: ededed
63+
description: Release please has triggered a release for this.
64+
- name: 'autorelease: tagged'
65+
color: ededed
66+
description: Release please has completed a release for this.
67+
68+
- name: 'tests: run'
69+
color: 3DED97
70+
description: Label to trigger Github Action tests.

.github/release-please.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2024 Google LLC
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+
handleGHRelease: true
16+
packageName: genai-toolbox-langchain-python
17+
releaseType: simple
18+
versionFile: "cmd/version.txt"

.github/sync-repo-settings.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
1615
# Synchronize repository settings from a centralized config
1716
# https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings
1817
# Install: https://github.com/apps/sync-repo-settings
@@ -23,14 +22,19 @@ squashMergeAllowed: true
2322
mergeCommitAllowed: false
2423
# Enable branch protection
2524
branchProtectionRules:
26-
- pattern: main
27-
isAdminEnforced: true
28-
requiredStatusCheckContexts:
29-
- 'cla/google'
30-
# - Add required status checks like presubmit tests
31-
requiredApprovingReviewCount: 1
32-
requiresCodeOwnerReviews: true
33-
requiresStrictStatusChecks: true
25+
- pattern: main
26+
isAdminEnforced: true
27+
requiredStatusCheckContexts:
28+
- "cla/google"
29+
- "lint"
30+
- "conventionalcommits.org"
31+
- "header-check"
32+
# - Add required status checks like presubmit tests
33+
- "unit tests (ubuntu-latest)"
34+
- "integration-test-pr (toolbox-testing-438616)"
35+
requiredApprovingReviewCount: 1
36+
requiresCodeOwnerReviews: true
37+
requiresStrictStatusChecks: true
3438

3539
# Set team access
3640
permissionRules:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2024 Google LLC
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+
steps:
16+
- id: Install library requirements
17+
name: 'python:${_VERSION}'
18+
args:
19+
- install
20+
- '-r'
21+
- './requirements.txt'
22+
- '--user'
23+
entrypoint: pip
24+
- id: Install test requirements
25+
name: 'python:${_VERSION}'
26+
args:
27+
- install
28+
- '.[test]'
29+
- '--user'
30+
entrypoint: pip
31+
- id: Run integration tests
32+
name: 'python:${_VERSION}'
33+
env:
34+
- TOOLBOX_URL=$_TOOLBOX_URL
35+
- TOOLBOX_VERSION=$_TOOLBOX_VERSION
36+
- GOOGLE_CLOUD_PROJECT=$PROJECT_ID
37+
args:
38+
- '-c'
39+
- >-
40+
python -m pytest ./tests/
41+
entrypoint: /bin/bash
42+
options:
43+
logging: CLOUD_LOGGING_ONLY
44+
substitutions:
45+
_VERSION: '3.13'
46+
_TOOLBOX_VERSION: '0.0.5'

.github/workflows/lint.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright 2024 Google LLC
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+
name: lint
16+
on:
17+
pull_request:
18+
paths:
19+
- './**'
20+
- '!./**/*.md'
21+
22+
# Declare default permissions as read only.
23+
permissions: read-all
24+
25+
jobs:
26+
lint:
27+
runs-on: ubuntu-latest
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.ref }}
30+
cancel-in-progress: true
31+
defaults:
32+
run:
33+
working-directory: ./
34+
steps:
35+
- name: Checkout Repository
36+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
37+
38+
- name: Setup Python
39+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
40+
with:
41+
python-version: "3.13"
42+
43+
- name: Install library requirements
44+
run: pip install -r requirements.txt
45+
46+
- name: Install test requirements
47+
run: pip install .[test]
48+
49+
- name: Run linters
50+
run: |
51+
black --check .
52+
isort --check .
53+
54+
- name: Run type-check
55+
env:
56+
MYPYPATH: './src'
57+
run: mypy --install-types --non-interactive --cache-dir=.mypy_cache/ -p toolbox_langchain_sdk

.github/workflows/sync-labels.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2024 Google LLC
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+
name: Sync Labels
16+
on:
17+
push:
18+
branches:
19+
- main
20+
21+
# Declare default permissions as read only.
22+
permissions: read-all
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: 'read'
29+
issues: 'write'
30+
pull-requests: 'write'
31+
steps:
32+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
33+
- uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
with:
37+
manifest: .github/labels.yaml

cmd/version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1

0 commit comments

Comments
 (0)