| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| |
| name: Python check |
| |
| on: |
| push: |
| branches: [ "main", "ci/*" ] |
| pull_request: |
| branches: [ "main" ] |
| |
| jobs: |
| build: |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| |
| steps: |
| - uses: actions/checkout@v3 |
| |
| - name: Setup Python |
| uses: actions/setup-python@v4 |
| with: |
| python-version: 3.12.1 |
| |
| - name: Install poetry |
| run: | |
| curl -sSL https://install.python-poetry.org | python3 - |
| |
| - name: Cache the virtualenv |
| uses: actions/cache@v4 |
| with: |
| path: ./.venv |
| key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} |
| |
| - name: Install dependencies |
| run: | |
| poetry install |
| |
| - name: Lint |
| run: | |
| poetry run pylint playground tests |
| |
| - name: Tests |
| run: | |
| poetry run pytest tests |