|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + lint: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
| 11 | + |
| 12 | + - name: Setup Python |
| 13 | + uses: actions/setup-python@v5 |
| 14 | + with: |
| 15 | + python-version: "3.10" |
| 16 | + |
| 17 | + - name: Install Poetry |
| 18 | + uses: abatilo/actions-poetry@v4 |
| 19 | + |
| 20 | + - name: Setup local virtual environment |
| 21 | + run: | |
| 22 | + poetry config virtualenvs.create true --local |
| 23 | + poetry config virtualenvs.in-project true --local |
| 24 | +
|
| 25 | + - name: Setup Poetry cache |
| 26 | + uses: actions/cache@v3 |
| 27 | + with: |
| 28 | + path: ./.venv |
| 29 | + key: venv-${{ hashFiles('**/poetry.lock') }} |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + run: poetry install --with dev |
| 33 | + |
| 34 | + - name: Run Ruff formatter check |
| 35 | + run: poetry run ruff format --check . |
| 36 | + |
| 37 | + - name: Run Ruff linter |
| 38 | + run: poetry run ruff check . |
| 39 | + |
| 40 | + test: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + env: |
| 43 | + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + |
| 47 | + - name: Setup Python |
| 48 | + uses: actions/setup-python@v5 |
| 49 | + with: |
| 50 | + python-version: "3.10" |
| 51 | + |
| 52 | + - name: Install Poetry |
| 53 | + uses: abatilo/actions-poetry@v4 |
| 54 | + |
| 55 | + - name: Setup local virtual environment |
| 56 | + run: | |
| 57 | + poetry config virtualenvs.create true --local |
| 58 | + poetry config virtualenvs.in-project true --local |
| 59 | +
|
| 60 | + - name: Set up Poetry cache |
| 61 | + uses: actions/cache@v3 |
| 62 | + with: |
| 63 | + path: ./.venv |
| 64 | + key: venv-${{ hashFiles('**/poetry.lock') }} |
| 65 | + |
| 66 | + - name: Install dependencies |
| 67 | + run: poetry install --with dev |
| 68 | + |
| 69 | + - name: Run unit tests |
| 70 | + run: poetry run pytest tests/unit/**/*.py --import-mode=importlib |
| 71 | + |
| 72 | + - name: Run integration tests |
| 73 | + run: poetry run pytest tests/integration |
0 commit comments