-
Notifications
You must be signed in to change notification settings - Fork 183
99 lines (89 loc) · 3.23 KB
/
ci-eval-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: CI
on:
pull_request:
branches:
- main
paths:
- trulens_eval/**/*
- .github/workflows/ci-eval-pr.yml
jobs:
PRBranchProtect:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: "3.12"
tests-folder: tests/unit
- python-version: "3.9"
tests-folder: tests/unit/static
- python-version: "3.10"
tests-folder: tests/unit/static
- python-version: "3.11"
tests-folder: tests/unit/static
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
clean: true
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
activate-environment: myenv
# - 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 -el {0}
- name: Install testing packages
run: |
conda activate myenv
pip install pytest==7.0.1 pytest-subtests pytest-azurepipelines --verbose
shell: bash -el {0}
- name: Describe python env
run: |
conda activate myenv
python --version
pip --version
pip list --verbose
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 -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: |
# 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 -el {0}
# env:
# TEST_OPTIONAL: true
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }}
# PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
# PINECONE_ENV: ${{ secrets.PINECONE_ENV }}
# HUGGINGFACEHUB_API_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }}