change python version support + add linters and pre-commit config #56
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 | |
env: | |
ENV: "TEST" | |
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} | |
HUGGING_FACE_KEY: ${{secrets.HUGGING_FACE_KEY}} | |
LOGLEVEL: "CRITICAL" | |
on: | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] | |
python-version: ["3.9", "3.10", "3.11"] | |
defaults: | |
run: | |
shell: bash | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-pip-wheels | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root --with test | |
- name: Install library | |
run: poetry install --no-interaction --with test | |
- name: Run Tests | |
run: echo "Running Tests" | |
- run: | | |
source $VENV | |
pytest tests |