Skip to content

Commit

Permalink
Merge pull request #7 from epinzur/fix-ci-2
Browse files Browse the repository at this point in the history
fix ci attempt 2
  • Loading branch information
epinzur authored Jun 6, 2024
2 parents 78a77f8 + 873112d commit 1512177
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions .github/workflows/ci-eval-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ on:
- main
paths:
- trulens_eval/**/*
- .github/workflows/ci-eval-pr.yml

jobs:
PRBranchProtect:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: 3.12
- python-version: "3.12"
tests-folder: tests/unit
- python-version: 3.9
- python-version: "3.9"
tests-folder: tests/unit/static
- python-version: 3.10
- python-version: "3.10"
tests-folder: tests/unit/static
- python-version: 3.11
- python-version: "3.11"
tests-folder: tests/unit/static
timeout-minutes: 30

Expand All @@ -30,62 +31,65 @@ jobs:
clean: true

- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: myenv
use-only-tar-bz2: true

- name: Install and run formatters
if: ${{ matrix.python-version }} == '3.11'
run: |
conda activate myenv
pip install yapf==0.32.0 isort==5.10.1 --verbose
./format.sh --eval
num_changed_files=`git ls-files --others -m --exclude-standard ./trulens_eval | wc -l`
if [ $num_changed_files -ne 0 ]; then
echo "The following files have changed after running format.sh. Please format your code and update the PR."
git ls-files --others -m --exclude-standard ./trulens_eval
git diff
fi
shell: bash
# - name: Install and run formatters
# if: ${{ matrix.python-version }} == '3.11'
# run: |
# conda activate myenv
# pip install yapf==0.32.0 isort==5.10.1 --verbose
# ./format.sh --eval
# num_changed_files=`git ls-files --others -m --exclude-standard ./trulens_eval | wc -l`
# if [ $num_changed_files -ne 0 ]; then
# echo "The following files have changed after running format.sh. Please format your code and update the PR."
# git ls-files --others -m --exclude-standard ./trulens_eval
# git diff
# fi
# shell: bash -el {0}

- name: Install trulens
run: |
conda activate myenv
cd ./trulens_eval
pip install -e . --verbose
shell: bash
shell: bash -el {0}

- name: Install testing packages
run: |
conda activate myenv
pip install pytest==7.0.1 pytest-subtests pytest-azurepipelines --verbose
shell: bash
shell: bash -el {0}

- name: Describe python env
run: |
conda activate myenv
python --version
pip --version
pip list --verbose
shell: bash
shell: bash -el {0}

- name: Unit tests with required packages
run: |
conda activate myenv
cd ./trulens_eval
python -m pytest --test-run-title="Required ${{ matrix.python-version }} unit tests" ${{ matrix.tests-folder }}
shell: bash
shell: bash -el {0}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }}
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_ENV: "us-west1-gcp-free"

# - name: Install optional packages and run tests
# run: |
# source activate ${{ matrix.python-version }}
# conda activate myenv
# cd ./trulens_eval
# pip install --verbose -r trulens_eval/requirements.optional.txt
# python -m pytest --test-run-title="Optional ${{ matrix.python-version }} unit tests" ${{ matrix.tests-folder }}
# shell: bash
# shell: bash -el {0}
# env:
# TEST_OPTIONAL: true
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand Down

0 comments on commit 1512177

Please sign in to comment.