Generate sync from async #207
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| lint-test-and-build: | |
| name: lint-test-and-build | |
| runs-on: ubuntu-latest | |
| environment: ci | |
| env: | |
| BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Set up virtualenv (Python 3.12) | |
| run: uv venv --python 3.12 | |
| - name: Install dependencies | |
| run: uv pip install -e .[dev] | |
| - name: Check generated sync code is up to date | |
| run: uv run unasyncd --check | |
| - name: Lint | |
| run: | | |
| # The CI ensures that the code is formatted and complain if not. | |
| # It's on US to commit already formatted clean code. | |
| uv run ruff check | |
| - name: Typecheck | |
| run: | | |
| uv run mypy src | |
| uv run python -c "import vercel, vercel.cache, vercel.headers, vercel.oidc, vercel.sandbox" | |
| - name: Run tests | |
| run: uv run pytest -v --capture=tee-sys --ignore=tests/test_examples.py | |
| - name: Run example tests | |
| run: uv run pytest -v --capture=tee-sys tests/test_examples.py -n auto | |
| - name: Build package | |
| run: uv run python -m build |