add ruff and ruff format project #120
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: Python Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'agentstack/**/*.py' | |
| - 'agentstack/**/*.ipynb' | |
| - 'tests/**/*.py' | |
| - 'tests/**/*.ipynb' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'agentstack/**/*.py' | |
| - 'agentstack/**/*.ipynb' | |
| - 'tests/**/*.py' | |
| - 'tests/**/*.ipynb' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.10,3.11,3.12] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.11' # Use a default Python version for running tox | |
| - name: Install tox | |
| run: pip install tox | |
| - name: Run tests with tox | |
| run: tox | |
| ruff: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install Ruff | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff | |
| - name: Run Ruff Format Check | |
| run: | | |
| # Check if any files would be reformatted | |
| ruff format --check . | |
| # Run Ruff linting checks | |
| ruff check . |