Skip to content

Merge pull request #94 from placeTW/chewing #381

Merge pull request #94 from placeTW/chewing

Merge pull request #94 from placeTW/chewing #381

Workflow file for this run

name: Run Unit Test via Pytest
on:
push:
paths:
- '**/*.py'
- .github/workflows/run_test.yml
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.8.3"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Poetry Dependencies Caching Step 1, set up a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Poetry Dependencies Caching Step 2, define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install dependencies using Poetry
run: poetry install
- name: Test with pytest
run: |
poetry run python -m pytest tests/ -s --durations=5
# - name: Generate Coverage Report
# run: |
# coverage report -m