Update python-package.yml #7
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: Python package | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, 3.10, 3.11] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python and Poetry | |
uses: packetcoders/action-setup-cache-python-poetry@main | |
with: | |
python-version: ${{ matrix.python-version }} | |
poetry-version: '1.7.1' # Specify the desired Poetry version | |
- name: Create and Activate Virtual Environment | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
- name: Install dependencies | |
run: poetry install | |
- name: Run tests | |
run: poetry run pytest |