Simplify base driver (#612) #806
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
name: Python Code Check in docs and README | |
on: | |
push: | |
paths: | |
- 'lavague-core/**' | |
- 'lavague-integrations/**' | |
- '_lavague/**' | |
- 'lavague-gradio/**' | |
- 'pyproject.toml' | |
- '.github/workflows/docs-code.yaml' | |
workflow_dispatch: | |
jobs: | |
check-code: | |
runs-on: ubuntu-latest | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
LAVAGUE_API_KEY: ${{ secrets.LAVAGUE_API_KEY }} | |
LAVAGUE_TELEMETRY: NONE | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set env | |
run: echo "LAVAGUE_UNIQUE_USER_ID=GITHUB_CI" >> $GITHUB_ENV | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Extract Python code from README.md | |
# Remove headless=False if it is present | |
run: | | |
sed -n '/```python/,/```/p' README.md | sed '/```*/d' | sed 's/headless=False//g' > check-code.py | |
- name: Install dependencies | |
run: | | |
pip install ./lavague-sdk | |
sudo apt-get install -y jq | |
pip freeze | grep lavague | |
git log | head -1 | |
- name: Check code consistency with docs/index.md | |
run: | | |
if ! diff -wu <(sed -n '/```python/,/```/p' README.md | sed '/```*/d') <(sed -n '/```python/,/```/p' docs/index.md | sed '/```*/d'); then | |
echo "The Python code blocks in README.md and docs/index.md do not match." | |
exit 1 | |
fi | |
- name: Remove Gradio demo line from CI | |
run: | | |
sed -i '/agent\.demo("Go on the quicktour of PEFT")/d' check-code.py | |
- name: Check code | |
run: cat check-code.py | |
- name: Run the Python script | |
run: python check-code.py |