forked from google-gemini/generative-ai-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from google-gemini/main
develop
- Loading branch information
Showing
405 changed files
with
94,849 additions
and
2,739 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
'status:awaiting review': | ||
- '**/*' | ||
|
||
'component:python sdk': | ||
- '**/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Validate samples | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] # new, updates | ||
|
||
jobs: | ||
update-python-list: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Changed Files | ||
id: changed_files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: | | ||
samples/*.py | ||
- name: Check Python samples | ||
env: | ||
NEW_FILES: ${{ steps.changed_files.outputs.all_modified_files }} | ||
README: samples/README.md | ||
run: | | ||
#!/bin/bash | ||
for file in ${NEW_FILES}; do | ||
echo "Testing $file" | ||
name=$(basename $file) | ||
if [[ -f ${file} ]]; then | ||
# File exists, so needs to be listed. | ||
if ! grep -q $name ${README}; then | ||
echo "Error: Sample not listed in README ($name)" | ||
exit 1 | ||
fi | ||
else | ||
# File does not exist, ensure it's not listed | ||
if grep -q $name ${README}; then | ||
echo "Error: Sample should not be listed in README ($name)" | ||
exit 1 | ||
fi | ||
fi | ||
done | ||
update-rest-list: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Changed Files | ||
id: changed_files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: | | ||
samples/rest/*.sh | ||
- name: Check REST samples | ||
env: | ||
NEW_FILES: ${{ steps.changed_files.outputs.all_modified_files }} | ||
README: samples/rest/README.md | ||
run: | | ||
#!/bin/bash | ||
for file in ${NEW_FILES}; do | ||
echo "Testing $file" | ||
if [[ -f ${file} ]]; then | ||
# File exists, so needs to be listed. | ||
echo $(basename $file) | ||
name=$(basename $file) | ||
if ! grep -q $name ${README}; then | ||
echo "Error: Sample not listed in README ($name)" | ||
exit 1 | ||
fi | ||
else | ||
# File does not exist, ensure it's not listed | ||
name=$(basename $file) | ||
if grep -q $name ${README}; then | ||
echo "Error: Sample should not be listed in README ($name)" | ||
exit 1 | ||
fi | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ | |
/.idea/ | ||
/.pytype/ | ||
/build/ | ||
/docs/api | ||
*.egg-info | ||
.DS_Store | ||
__pycache__ | ||
*.iml | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.