Repository navigation
56 lines (46 loc) · 1.74 KB
/
Copy pathci.yml
File metadata and controls
56 lines (46 loc) · 1.74 KB
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
name: CI
# Tests only, and only on pull requests labelled "CI". Adding the label starts a
# run; later pushes to a labelled PR re-run it. Images are built by CD (cd.yml).
on:
pull_request:
types: [labeled, synchronize, reopened]
permissions:
contents: read
jobs:
test:
# Skip runs triggered by adding some other label.
if: >-
contains(github.event.pull_request.labels.*.name, 'CI') &&
(github.event.action != 'labeled' || github.event.label.name == 'CI')
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: test_key
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
cache-dependency-path: |
requirements.lite.txt
test_requirements.txt
- name: Install pandoc
# The .docx /text path converts through pandoc, and the end-to-end tests
# for it skip silently without the binary — a green run that proved nothing.
run: |
sudo apt-get update
sudo apt-get install -y pandoc
pandoc --version | head -1
- name: Install dependencies
# Test against the lite dependency set: it is the only image we ship.
run: pip install -r requirements.lite.txt -r test_requirements.txt
- name: Run unit tests
run: pytest -ra --maxfail=1 --disable-warnings --junitxml=test-results-unit.xml
- name: Run integration tests (pgvector container)
run: pytest -m integration --maxfail=3 --disable-warnings --junitxml=test-results-integration.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results-*.xml