Skip to content

Commit 8b15548

Browse files
authored
Various improvements (#26)
* Add info about badges Add coverage report to github pages * Remove link in README
1 parent 2195177 commit 8b15548

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

.github/workflows/build_docs.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ on:
44
push:
55
branches:
66
- main
7-
87
jobs:
98
deploy:
109
runs-on: ubuntu-22.04
10+
env:
11+
# Directory that will be published on github pages
12+
PUBLISH_DIR: ./docs/_build/html
13+
1114
steps:
1215
- uses: actions/checkout@v3
1316

@@ -17,12 +20,22 @@ jobs:
1720
python-version: "3.10"
1821

1922
- name: Install dependencies
20-
run: python -m pip install ".[docs]"
23+
run: python -m pip install ".[test,docs]"
24+
2125
- name: Build docs
2226
run: make doc
2327

28+
- name: Copy Dockerfile into gh-pages
29+
run: cp Dockerfile ${PUBLISH_DIR}
30+
31+
- name: Add coverage report to github pages
32+
run: |
33+
python -m pytest --cov=mypackage test
34+
python -m coverage html
35+
cp -r htmlcov ${PUBLISH_DIR}
36+
2437
- name: Deploy
2538
uses: peaceiris/actions-gh-pages@v3
2639
with:
2740
github_token: ${{ secrets.GITHUB_TOKEN }}
28-
publish_dir: ./docs/_build/html
41+
publish_dir: ${PUBLISH_DIR}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN apt-get purge -y python3-setuptools
1515
# Install mypackage
1616
WORKDIR /tmp/
1717
RUN git clone https://github.com/jorgensd/reproducibility && \
18-
pip3 install ./reproducibility[docs]
18+
pip install ./reproducibility[docs]
1919

2020
RUN rm -rf /tmp
2121

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
# Reproducible workflow for researchers
2-
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://jorgensd.github.io/reproducibility)
3-
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
42

53
This repository is a template for how to set up a reproducible python environment with GitHub.
64

5+
## Badges
6+
7+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jorgensd/reproducibility/gh-pages?labpath=_sources)
8+
9+
To get the `Launch Binder` badge, go to: [https://mybinder.org/](https://mybinder.org/) and fill in (specifics for this repo in brackets):
10+
- Your Github repository (https://github.com/jorgensd/reproducibility)
11+
- Git ref (`gh-pages`, see: [How to create github pages](#ghpages))
12+
- Path to notebook file (`_sources`, as generated by `jupyter-book`, see [Jupyter-book](#jupyterbook))
13+
14+
Then press `Launch`, and then `Expand to see the text below, paste it into your README to show a binder badge` and copy the markdown code. If you render the README.md file as plaintext, you can see all the settings explicitly in the image link
15+
16+
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://jorgensd.github.io/reproducibility)
17+
18+
Replace link in image (https://jorgensd.github.io/reproducibility) with your [Github pages url](#ghpages)
19+
20+
![MIT License](https://img.shields.io/github/license/jorgensd/reproducibility)
21+
22+
Replace `username/repo` in image link with appropriate user/respository.
23+
724
## Python-packaging
825

926
To be able to create a python package, we need a folder with the name of the package (in this repository it is called `mypackage`, located under `src/mypackage`), and a `pyproject.toml` file.
@@ -24,4 +41,13 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for ways to get started.
2441

2542
A good idea is to look at the [issue tracker](https://github.com/jorgensd/reproducibility/issues) and see if you can resolve any open issues. A list of good first issues can be found [here](https://github.com/jorgensd/reproducibility/contribute)
2643

27-
If you find a bug in the source code, please [open an issue](https://github.com/jorgensd/reproducibility/issues/new/choose).
44+
If you find a bug in the source code, please [open an issue](https://github.com/jorgensd/reproducibility/issues/new).
45+
46+
47+
## <a id="ghpages"></a> Auto-publish to Github Pages
48+
49+
Add text
50+
51+
## <a id="jupyterbook"></a> Jupyter-book
52+
53+
Add text

0 commit comments

Comments
 (0)