|
8 | 8 | branches: [ main, master ] |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - test: |
12 | | - runs-on: ubuntu-latest |
13 | | - permissions: |
14 | | - contents: write |
15 | | - strategy: |
16 | | - matrix: |
17 | | - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] |
18 | | - dependency-versions: ['latest'] |
19 | | - fail-fast: false |
20 | | - |
21 | | - steps: |
22 | | - - uses: actions/checkout@v4 |
23 | | - with: |
24 | | - ref: ${{ github.head_ref }} |
25 | | - fetch-depth: 0 |
26 | | - |
27 | | - - name: Set up Python ${{ matrix.python-version }} |
28 | | - uses: actions/setup-python@v5 |
29 | | - with: |
30 | | - python-version: ${{ matrix.python-version }} |
31 | | - cache: 'pip' |
32 | | - cache-dependency-path: | |
33 | | - setup.py |
34 | | - pyproject.toml |
35 | | - requirements*.txt |
36 | | - |
37 | | - - name: Install build dependencies |
38 | | - run: | |
39 | | - python -m pip install --upgrade pip setuptools wheel |
40 | | - python -m pip install build |
41 | | - |
42 | | - - name: Install dependencies |
43 | | - run: | |
44 | | - python -m pip install --upgrade pip setuptools wheel |
45 | | - python -m pip install '.[dev]' |
46 | | - python -m pip install pytest pytest-cov |
47 | | - |
48 | | - - name: Run tests |
49 | | - continue-on-error: true # This ensures test failures don't block the workflow |
50 | | - run: | |
51 | | - python -m pytest --cov=lazypredict tests/ --cov-report=xml --cov-fail-under=80 || true |
52 | | - |
53 | | - - name: Upload coverage |
54 | | - continue-on-error: true # This ensures coverage upload failures don't block the workflow |
55 | | - uses: codecov/codecov-action@v4 |
56 | | - with: |
57 | | - token: ${{ secrets.CODECOV_TOKEN }} |
58 | | - files: ./coverage.xml |
59 | | - fail_ci_if_error: false # This ensures coverage failures don't block the workflow |
60 | | - |
61 | | - docs: |
62 | | - needs: test |
63 | | - if: always() # This ensures the docs job runs even if tests fail |
64 | | - runs-on: ubuntu-latest |
65 | | - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') |
66 | | - |
67 | | - steps: |
68 | | - - uses: actions/checkout@v4 |
69 | | - - name: Set up Python |
70 | | - uses: actions/setup-python@v5 |
71 | | - with: |
72 | | - python-version: '3.12' |
73 | | - cache: 'pip' |
74 | | - cache-dependency-path: | |
75 | | - setup.py |
76 | | - pyproject.toml |
77 | | - requirements*.txt |
78 | | - |
79 | | - - name: Install dependencies |
80 | | - run: | |
81 | | - python -m pip install --upgrade pip |
82 | | - pip install '.[dev]' |
83 | | - pip install sphinx sphinx-rtd-theme myst-parser myst-nb |
84 | | - |
85 | | - - name: Build documentation |
86 | | - run: | |
87 | | - cd docs |
88 | | - make html |
89 | | - |
90 | | - - name: Deploy documentation |
91 | | - uses: peaceiris/actions-gh-pages@v3 |
92 | | - with: |
93 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
94 | | - publish_dir: ./docs/build/html |
95 | | - keep_files: true |
96 | | - commit_message: "docs: update documentation" |
97 | | - |
98 | 11 | publish: |
99 | | - needs: [test, docs] |
100 | 12 | runs-on: ubuntu-latest |
101 | 13 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') |
102 | 14 | permissions: |
|
0 commit comments