File size: 1,935 Bytes
54b075d
 
 
 
 
 
 
 
 
 
 
be56d87
 
 
 
 
54b075d
 
 
be56d87
54b075d
 
be56d87
54b075d
 
 
 
 
 
2264f13
 
 
 
 
be56d87
 
 
 
 
 
54b075d
2264f13
 
54b075d
 
 
1c34fec
 
 
 
54b075d
be56d87
 
 
 
 
1278752
be56d87
f9f130e
be56d87
 
 
 
 
e3018af
2a9fa9a
be56d87
 
 
 
 
 
 
 
 
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.10", "3.11", "3.12"]
      fail-fast: false

    steps:
      - uses: actions/checkout@v4

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          cache: "pip"

      - name: Install Poetry
        run: |
          pipx install poetry

      - name: Configure Poetry
        run: |
          poetry config virtualenvs.create true
          poetry config virtualenvs.in-project true

      - name: Cache Poetry virtualenv
        uses: actions/cache@v3
        with:
          path: ./.venv
          key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

      - name: Install dependencies
        run: |
          poetry install

      - name: Run pre-commit hooks
        uses: pre-commit/[email protected]
        with:
          extra_args: --all-files
        env:
          PRE_COMMIT_CACHE_KEY: ${{ hashFiles('.pre-commit-config.yaml', 'pyproject.toml') }}

      - name: Run tests with coverage
        run: |
          poetry run pytest --cov=llmdataparser --cov-report=xml

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          file: ./coverage.xml
          fail_ci_if_error: true

      - name: Build documentation
        run: |
          poetry add mkdocs mkdocs-material --group dev
          cp README.md docs/index.md
          poetry run mkdocs build
        if: matrix.python-version == '3.12'

      - name: Upload documentation artifact
        uses: actions/upload-artifact@v3
        with:
          name: documentation
          path: site/
        if: matrix.python-version == '3.12'