Fix ollama issues #1402
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
LANDINGAI_DEV_API_KEY: ${{ secrets.LANDINGAI_DEV_API_KEY }} | |
OPENAI_API_KEY: 123test | |
PYTHONUTF8: 1 | |
jobs: | |
unit_test: | |
name: Test | |
strategy: | |
matrix: | |
python-version: [3.9, 3.11] | |
os: [ ubuntu-22.04, windows-2022, macos-14 ] | |
runs-on: ${{ matrix.os }} | |
env: | |
RUNTIME_TAG: ci_job | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Python Poetry | |
uses: abatilo/actions-poetry@v2.1.0 | |
with: | |
poetry-version: 1.4.2 | |
- name: Configure poetry | |
shell: bash | |
run: poetry config virtualenvs.in-project true | |
- name: Print Python environment information | |
run: | | |
poetry env info | |
poetry --version | |
poetry run pip -V | |
- name: Install dependencies | |
run: | | |
# Install main dependencies first so we can see their size | |
poetry install --all-extras | |
- name: Linting | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
poetry run flake8 . --exclude .venv,examples,tests --count --show-source --statistics | |
- name: Check Format | |
run: | | |
poetry run black --check --diff --color vision_agent/ | |
- name: Type Checking | |
run: | | |
poetry run mypy vision_agent | |
- name: Test with pytest | |
run: | | |
poetry run pytest -s -vvv tests/unit | |
integ_test: | |
name: Integration Test | |
runs-on: ubuntu-22.04 | |
env: | |
RUNTIME_TAG: ci_job | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Python Poetry | |
uses: abatilo/actions-poetry@v2.1.0 | |
with: | |
poetry-version: 1.4.2 | |
- name: Configure poetry | |
shell: bash | |
run: poetry config virtualenvs.in-project true | |
- name: Print Python environment information | |
run: | | |
poetry env info | |
poetry --version | |
poetry run pip -V | |
- name: Install dependencies | |
run: | | |
# Install main dependencies first so we can see their size | |
poetry install --all-extras | |
- name: Test with pytest | |
run: | | |
poetry run pytest -v tests/integ | |
release: | |
name: Release | |
needs: unit_test | |
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):') && !contains(github.event.head_commit.message, '[skip release]') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.10.11 | |
- name: Install Python Poetry | |
uses: abatilo/actions-poetry@v2.1.0 | |
with: | |
poetry-version: 1.4.2 | |
- name: Configure poetry | |
shell: bash | |
run: poetry config virtualenvs.in-project true | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: setup git config | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "yazhou.cao@landing.ai" | |
- name: Bump up version | |
run: | | |
poetry version patch | |
git add pyproject.toml | |
new_version=`poetry version` | |
git commit -m "[skip ci] chore(release): ${new_version}" | |
git push -f | |
- name: Publish to PyPI | |
run: | | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
poetry publish --build -vvv |