Merge pull request #87 from sbintuitions/fix/handle_prompt_length_for… #221
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: Run tests | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
workflow_dispatch: | |
inputs: | |
no-cache: | |
description: "Run tests without cache" | |
default: false | |
required: false | |
type: boolean | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
env: | |
PYTHON_VERSION: "3.10" | |
NO_CACHE: ${{ github.event.inputs.no-cache || 'false' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: | | |
pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: "poetry" | |
- name: Install dependencies | |
run: poetry install | |
- name: Download unidic artifacts | |
run: | | |
if [ ! -f "$(poetry env info -p)/lib/python$PYTHON_VERSION/site-packages/unidic/dicdir/version" ]; then | |
poetry run python -m unidic download | |
fi | |
- name: Run tests | |
run: | | |
poetry run pytest -v -s ./tests | |
lint_check: | |
runs-on: ubuntu-latest | |
env: | |
PYTHON_VERSION: "3.10" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Poetry | |
run: | | |
pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: "poetry" | |
- name: Install dev dependencies | |
run: | | |
poetry install --only dev | |
- name: Check black and isort and flake8 | |
run: | | |
poetry run black --check --diff . | |
poetry run isort --check-only --diff . | |
poetry run flake8 . | |
markdown_lint_check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: markdownlint-cli | |
uses: nosborn/[email protected] | |
with: | |
files: README.md | |
config_file: .markdownlint.yaml |