mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-20 06:55:08 +00:00
Use pip (not conda) to install khoj, run pytest in Github Workflow
This commit is contained in:
parent
71fcb1087f
commit
f9a10ad5ee
1 changed files with 17 additions and 38 deletions
55
.github/workflows/test.yml
vendored
55
.github/workflows/test.yml
vendored
|
@ -22,50 +22,29 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
||||||
- os: ubuntu-latest
|
|
||||||
label: linux-64
|
|
||||||
prefix: /usr/share/miniconda3/envs/test
|
|
||||||
|
|
||||||
name: ${{ matrix.label }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Environment Dependencies
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Install System Dependencies
|
||||||
shell: bash -l {0}
|
shell: bash -l {0}
|
||||||
run: sudo apt-get -y install libimage-exiftool-perl
|
run: sudo apt-get -y install libimage-exiftool-perl
|
||||||
|
|
||||||
- name: Setup Mambaforge
|
- name: Install Python Dependencies
|
||||||
uses: conda-incubator/setup-miniconda@v2
|
run: |
|
||||||
with:
|
python -m pip install --upgrade pip
|
||||||
miniforge-variant: Mambaforge
|
pip install pytest
|
||||||
miniforge-version: latest
|
pip install -upgrade .
|
||||||
activate-environment: test
|
|
||||||
use-mamba: true
|
|
||||||
environment-file: config/environment.yml
|
|
||||||
python-version: 3.8
|
|
||||||
auto-activate-base: false
|
|
||||||
use-only-tar-bz2: true
|
|
||||||
|
|
||||||
- name: Set cache date
|
- name: Test with pytest
|
||||||
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
run: |
|
||||||
|
pytest
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ matrix.prefix }}
|
|
||||||
key: ${{ matrix.label }}-conda-${{ hashFiles('config/environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
|
|
||||||
env:
|
|
||||||
# Increase this value to reset cache if environment.yml has not changed
|
|
||||||
CACHE_NUMBER: 0
|
|
||||||
id: cache
|
|
||||||
|
|
||||||
- name: Update environment
|
|
||||||
run: mamba env update -n test -f config/environment.yml
|
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
|
||||||
|
|
||||||
- name: Run Pytest
|
|
||||||
shell: bash -l {0}
|
|
||||||
run: python -m pytest
|
|
Loading…
Add table
Reference in a new issue