Skip to content

Commit 21b9dcd

Browse files
committed
Publish docs on GitHub Pages and report coverage via Codecov
Replace the (unused) Read the Docs setup with a GitHub Actions workflow (.github/workflows/docs.yml) that builds the Sphinx docs and deploys them to GitHub Pages, and extend the tests workflow to upload coverage to Codecov (pytest --cov-report=xml + codecov-action on the 3.12 job). Add codecov.yml (informational coverage, excluding tests/gui/notebooks) and swap the README RTD badge for GitHub Pages docs and Codecov badges; remove .readthedocs.yaml.
1 parent f725af0 commit 21b9dcd

5 files changed

Lines changed: 66 additions & 17 deletions

File tree

.github/workflows/docs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
# allow the workflow to publish to GitHub Pages
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.12"
25+
cache: pip
26+
- name: Install documentation dependencies
27+
run: pip install -r docs/requirements.txt
28+
- name: Build the Sphinx documentation
29+
run: sphinx-build -b html docs docs/_build/html
30+
- uses: actions/upload-pages-artifact@v3
31+
with:
32+
path: docs/_build/html
33+
34+
deploy:
35+
needs: build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
40+
steps:
41+
- id: deployment
42+
uses: actions/deploy-pages@v4

.github/workflows/tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,11 @@ jobs:
3737
continue-on-error: true
3838

3939
- name: Run tests
40-
run: pytest --cov=./
40+
run: pytest --cov=./ --cov-report=xml
41+
42+
- name: Upload coverage to Codecov
43+
if: matrix.python-version == '3.12'
44+
uses: codecov/codecov-action@v4
45+
with:
46+
files: ./coverage.xml
47+
fail_ci_if_error: false

.readthedocs.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
# `aima-python` [![tests](https://github.com/aimacode/aima-python/actions/workflows/tests.yml/badge.svg)](https://github.com/aimacode/aima-python/actions/workflows/tests.yml) [![Documentation Status](https://readthedocs.org/projects/aima-python/badge/?version=latest)](https://aima-python.readthedocs.io/en/latest/?badge=latest) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/aimacode/aima-python/master)
3+
# `aima-python` [![tests](https://github.com/aimacode/aima-python/actions/workflows/tests.yml/badge.svg)](https://github.com/aimacode/aima-python/actions/workflows/tests.yml) [![docs](https://github.com/aimacode/aima-python/actions/workflows/docs.yml/badge.svg)](https://aimacode.github.io/aima-python/) [![codecov](https://codecov.io/gh/aimacode/aima-python/branch/master/graph/badge.svg)](https://codecov.io/gh/aimacode/aima-python) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/aimacode/aima-python/master)
44

55

66
Python code for the book *[Artificial Intelligence: A Modern Approach](http://aima.cs.berkeley.edu).* You can use this in conjunction with a course on AI, or for study on your own. We're looking for [solid contributors](https://github.com/aimacode/aima-python/blob/master/CONTRIBUTING.md) to help.

codecov.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Codecov configuration. Coverage is reported but never fails CI (informational),
2+
# and non-library files are excluded from the percentage.
3+
coverage:
4+
status:
5+
project:
6+
default:
7+
informational: true
8+
patch:
9+
default:
10+
informational: true
11+
12+
ignore:
13+
- "tests/**"
14+
- "gui/**"
15+
- "**/*.ipynb"

0 commit comments

Comments
 (0)