Skip to content

Commit

Permalink
CI: only run client lint once
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Apr 24, 2023
1 parent 2dd99a2 commit 6d33c04
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/backend.yml
Expand Up @@ -56,7 +56,28 @@ jobs:
- name: Tests
shell: bash
run: |
bash scripts/ci.sh
bash scripts/test.sh
client-lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: client/python
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: pip
cache-dependency-path: |
requirements.txt
test/requirements.txt
- name: Install Client
run: |
pip install -e .
pip install -r test/requirements.txt
- name: Lint
run: bash scripts/lint.sh
test:
strategy:
matrix:
Expand Down
6 changes: 2 additions & 4 deletions client/python/scripts/ci.sh → client/python/scripts/lint.sh
@@ -1,12 +1,10 @@
#!/bin/bash
set -e

cd "$(dirname ${0})/.."

echo "Linting..."
ruff test gradio_client
black --check test gradio_client
pyright gradio_client/*.py

echo "Testing..."
python -m pytest test
echo "Type checking the client library with pyright"
pyright gradio_client/*.py
7 changes: 7 additions & 0 deletions client/python/scripts/test.sh
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

cd "$(dirname ${0})/.."

echo "Testing..."
python -m pytest test

0 comments on commit 6d33c04

Please sign in to comment.