update #38
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: Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| schedule: | |
| - cron: '0 0 * * *' # Daily at midnight UTC | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| test: | |
| name: Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ['3.8', '3.9', '3.10', '3.11'] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y python3-venv | |
| - name: Install Poetry | |
| run: | | |
| pip install "poetry==1.5.1" | |
| echo "$(python -m site --user-base)/bin" >> $GITHUB_PATH | |
| - name: Configure Poetry | |
| run: | | |
| poetry config virtualenvs.create true | |
| poetry config virtualenvs.in-project true | |
| poetry config --list | |
| poetry --version | |
| - name: Install dependencies | |
| run: | | |
| # Install dependencies with verbose output for better debugging | |
| poetry install --with dev,test --no-interaction --no-ansi -v | |
| poetry env info | |
| echo "Installed packages:" | |
| poetry show --tree | |
| - name: Run tests with coverage | |
| run: | | |
| poetry run pytest --cov=dialogchain --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./coverage.xml | |
| fail_ci_if_error: false | |
| - name: Run type checking | |
| run: | | |
| poetry run mypy src/dialogchain tests | |
| - name: Lint with flake8 | |
| run: | | |
| poetry run flake8 src/dialogchain tests | |
| - name: Check formatting with black | |
| run: | | |
| poetry run black --check src tests | |
| - name: Check import sorting with isort | |
| run: | | |
| poetry run isort --check-only src tests |