-
Notifications
You must be signed in to change notification settings - Fork 12
50 lines (40 loc) · 1.23 KB
/
ci.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
name: Run tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9] # Adjust this as necessary for other versions
steps:
- uses: actions/checkout@v3
- name: Set up Python and cache pip
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # Enabling built-in pip caching
- name: Cache Python environment
uses: actions/[email protected]
id: env-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pythonenv-${{ matrix.python-version }}-${{ hashFiles('rag/requirements.txt') }}
- name: Install pip dependencies
if: steps.env-cache.outputs.cache-hit != 'true'
run: |
pip install -r rag/requirements.txt
- name: Cache pytest artifacts
uses: actions/[email protected]
with:
path: .pytest_cache
key: ${{ runner.os }}-pytest-${{ github.sha }}
- name: Set PYTHONPATH
run: echo "PYTHONPATH=${{ github.workspace }}" >> $GITHUB_ENV
- name: Run pytest
run: pytest tests --capture=no # Disable capturing to allow live logging