Skip to content

Add github workflow for linting and testing #4

Add github workflow for linting and testing

Add github workflow for linting and testing #4

Workflow file for this run

name: Linting and testing
on:
push:
branches:
- dev
- main
pull_request:
branches:
- dev
- main
workflow_dispatch:
env:
PYRIGHT_PYTHON_FORCE_VERSION: 1.1.268
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install wheel setuptools
- name: Build packages
run: |
for pkg in vibe_core vibe_common vibe_agent vibe_server vibe_dev; do cd src/$pkg && python setup.py bdist_wheel --dist-dir ../../dist; cd ../../; done
- name: Save packages
uses: actions/upload-artifact@v4
with:
name: packages
path: dist
test:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
package-to-test: [vibe_core, vibe_common, vibe_server, vibe_agent]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Retrieve packages
uses: actions/download-artifact@v4
with:
name: packages
path: dist
- name: Install dependencies
run: |
pip install pyright ruff
- name: Install package
run: |
pip install ${{ matrix.package-to-test }}[test] --find-links dist
- name: Lint with ruff
run: |
ruff check ./src/${{ matrix.package-to-test }} --config ./.ruff.toml
- name: Test with pytest
run: |
pip install vibe_dev --find-links dist
pytest ./src/${{ matrix.package-to-test}} -v --junitxml=junit/test-results.xml --cov=. --cov-report=xml