-
Notifications
You must be signed in to change notification settings - Fork 15
50 lines (39 loc) · 1.24 KB
/
build.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
---
# Build and test the code
name: Build
on: [push, pull_request]
jobs:
pre-commit:
name: Pre-commit (linting)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
pytest-in-venv:
name: Python tests
runs-on: macos-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
timeout-minutes: 5
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install dependencies
run: pip install -r requirements/requirements-test.txt
- name: Run configure to create the config file
run: python -m aicodebot.cli configure
- name: Run the tests with coverage
# We use record-mode=new_episodes to record new API responses, because some times the open ai
# API calls a different host
run: pytest --cov=./ --cov-report=xml --record-mode=new_episodes
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4