Skip to content

Commit 75dabb7

Browse files
authored
Merge pull request #6 from HakimBenkirane/ci-cd
CI workflow
2 parents 8a4846a + 4ed4192 commit 75dabb7

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Setup Python Environment"
2+
description: "Set up Python environment for the given Python version"
3+
4+
inputs:
5+
python-version:
6+
description: "Python version to use"
7+
required: true
8+
default: "3.10"
9+
uv-version:
10+
description: "uv version to use"
11+
required: true
12+
default: "0.5.20"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Install python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ inputs.python-version }}
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v2
24+
with:
25+
version: ${{ inputs.uv-version }}
26+
enable-cache: "true"
27+
cache-suffix: ${{ matrix.python-version }}
28+
29+
- name: Install Python dependencies
30+
run: uv sync --frozen
31+
shell: bash

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v3
16+
- uses: pre-commit/action@v3.0.1
17+
18+
tests:
19+
needs: [pre-commit]
20+
name: "pytest with uv"
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
matrix:
25+
python-version: ["3.10", "3.11"]
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Set up the environment
31+
uses: ./.github/actions/setup-python-env
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Tests
36+
run: uv run pytest
37+
38+
test_pip_install:
39+
needs: [pre-commit]
40+
name: "pytest with pip install"
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v5
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v6
48+
with:
49+
python-version: "3.12"
50+
51+
- name: pip installation
52+
run: pip install -e . && pip install pytest-cov poethepoet
53+
54+
- name: Run short tests
55+
run: poe test_no_multimodal

0 commit comments

Comments
 (0)