-
Notifications
You must be signed in to change notification settings - Fork 71
59 lines (53 loc) · 1.55 KB
/
workflow.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
name: Python package workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Run critical tests
env:
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
run: poetry run pytest tests/critical/ -v
- name: Build package
run: poetry build
test-python-versions:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Verify Python version
run: |
python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
if python -c "import sys; exit(0 if sys.version_info >= (3, 9) and sys.version_info < (4, 0) else 1)"; then
echo "Python version $python_version meets requirements (>=3.9, <4.0)"
else
echo "Python version $python_version does not meet requirements (>=3.9, <4.0)"
exit 1
fi
- name: Test installation
run: |
pip install poetry
poetry install