-
Notifications
You must be signed in to change notification settings - Fork 692
83 lines (72 loc) · 2.63 KB
/
build_package.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
name: Build Package
on:
push:
branches: [ "master", "qa" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clean up before build
run: |
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /tmp/*
sudo rm -rf $HOME/.cache/pip
df -h
- name: Set up Python environment and install dependencies
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Build
run: poetry build
- name: Set up test environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install the package
run: |
WHEEL_FILE=$(ls dist/*.whl)
pip install "${WHEEL_FILE}[all,test]"
- name: Test import
run: |
source venv/bin/activate
python -c "import camel"
- name: Run tests with Pytest
env:
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
GOOGLE_API_KEY: "${{ secrets.GOOGLE_API_KEY }}"
SEARCH_ENGINE_ID: "${{ secrets.SEARCH_ENGINE_ID }}"
OPENWEATHERMAP_API_KEY: "${{ secrets.OPENWEATHERMAP_API_KEY }}"
ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"
GROQ_API_KEY: "${{ secrets.GROQ_API_KEY }}"
COHERE_API_KEY: "${{ secrets.COHERE_API_KEY }}"
HF_TOKEN: "${{ secrets.HF_TOKEN }}"
AZURE_OPENAI_API_KEY: "${{ secrets.AZURE_OPENAI_API_KEY }}"
AZURE_API_VERSION: "${{ secrets.AZURE_API_VERSION }}"
AZURE_DEPLOYMENT_NAME: "${{ secrets.AZURE_DEPLOYMENT_NAME }}"
AZURE_OPENAI_BASE_URL: "${{ secrets.AZURE_OPENAI_BASE_URL }}"
MISTRAL_API_KEY: "${{ secrets.MISTRAL_API_KEY }}"
REKA_API_KEY: "${{ secrets.REKA_API_KEY }}"
NEO4J_URI: "${{ secrets.NEO4J_URI }}"
NEO4J_USERNAME: "${{ secrets.NEO4J_USERNAME }}"
NEO4J_PASSWORD: "${{ secrets.NEO4J_PASSWORD }}"
FIRECRAWL_API_KEY: "${{ secrets.FIRECRAWL_API_KEY }}"
ASKNEWS_CLIENT_ID: "${{ secrets.ASKNEWS_CLIENT_ID }}"
ASKNEWS_CLIENT_SECRET: "${{ secrets.ASKNEWS_CLIENT_SECRET }}"
CHUNKR_API_KEY: "${{ secrets.CHUNKR_API_KEY }}"
run: |
source venv/bin/activate
pytest --fast-test-mode ./test
- name: Clean up after build
if: always()
run: |
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /tmp/*
sudo rm -rf $HOME/.cache/pip
df -h