Merge pull request #49 from ericmjl/lancedb #533
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 pull requests | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
env: | |
OPENAI_API_KEY: dummy_key | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
name: Run test suite (Python ${{ matrix.python-version }}, ${{ matrix.environment-type }}) | |
strategy: | |
matrix: | |
python-version: [3.11] | |
environment-type: ['miniconda', 'bare'] | |
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Python environment | |
if: matrix.environment-type == 'bare' | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# # See: https://github.com/marketplace/actions/setup-miniconda | |
# - name: Setup miniconda | |
# if: matrix.environment-type == 'miniconda' | |
# uses: conda-incubator/setup-miniconda@v2 | |
# with: | |
# auto-update-conda: true | |
# miniforge-variant: Mambaforge | |
# channels: conda-forge | |
# activate-environment: llamabot | |
# environment-file: environment.yml | |
# use-mamba: true | |
# python-version: ${{ matrix.python-version }} | |
- uses: mamba-org/setup-micromamba@v1 | |
if: matrix.environment-type == 'miniconda' | |
with: | |
micromamba-version: '1.5.1-2' | |
environment-file: environment.yml | |
init-shell: >- | |
bash | |
cache-environment: true | |
cache-environment-key: environment-${{ steps.date.outputs.date }}-${{ hashFiles('environment.yml') }} | |
cache-downloads-key: downloads-${{ steps.date.outputs.date }}-${{ hashFiles('environment.yml') }} | |
post-cleanup: 'all' | |
- name: Install dependencies | |
if: matrix.environment-type == 'bare' | |
# 17 June 2023: Figure out a way to move testing deps to the `pip install -e .` step below. | |
run: | | |
python -m pip install -e ".[all]" | |
- name: Run tests | |
run: | | |
if [ "${{ matrix.environment-type }}" == "miniconda" ]; then | |
conda activate llamabot | |
fi | |
pip install -e ".[all]" | |
pytest | |
- name: Test CLI | |
run: | | |
pip install -e ".[all]" | |
llamabot --help | |
# https://github.com/codecov/codecov-action | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
# fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) |