Skip to content

Commit

Permalink
infrastructure updates
Browse files Browse the repository at this point in the history
* enable codecov
* use github pages for docs
* update gh actions
  • Loading branch information
PicoCentauri committed Feb 29, 2024
1 parent 0def465 commit 41a6330
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
if: ${{ false }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- run: pip install tox

- name: Test build integrity
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: install dependencies
run: |
Expand All @@ -27,25 +27,25 @@ jobs:
# Use the CPU only version of torch when building/running the code
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu

# - name: put documentation in the website
# run: |
# git clone https://github.com/$GITHUB_REPOSITORY --branch gh-pages gh-pages
# rm -rf gh-pages/.git
# cd gh-pages
- name: put documentation in the website
run: |
git clone https://github.com/$GITHUB_REPOSITORY --branch gh-pages gh-pages
rm -rf gh-pages/.git
cd gh-pages
# REF_KIND=$(echo $GITHUB_REF | cut -d / -f2)
# if [[ "$REF_KIND" == "tags" ]]; then
# TAG=${GITHUB_REF#refs/tags/}
# mv ../docs/build/html $TAG
# else
# rm -rf latest
# mv ../docs/build/html latest
# fi
REF_KIND=$(echo $GITHUB_REF | cut -d / -f2)
if [[ "$REF_KIND" == "tags" ]]; then
TAG=${GITHUB_REF#refs/tags/}
mv ../docs/build/html $TAG
else
rm -rf latest
mv ../docs/build/html latest
fi
# - name: deploy to gh-pages
# if: github.event_name == 'push'
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./gh-pages/
# force_orphan: true
- name: deploy to gh-pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages/
force_orphan: true
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- run: pip install tox

- name: Lint the code
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,36 @@ jobs:
# - os: ubuntu-22.04
# python-version: "3.8"
- os: ubuntu-22.04
python-version: "3.11"
python-version: "3.12"
# - os: macos-11
# python-version: "3.8"
# - os: macos-11
# python-version: "3.11"
# python-version: "3.12"
# - os: windows-2019
# python-version: "3.8"
# - os: windows-2019
# python-version: "3.11"
# python-version: "3.12"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install tox
- run: pip install tox coverage[toml]

- name: run Python tests
run: tox -e tests
run: |
tox -e tests
coverage xml
env:
# Use the CPU only version of torch when building/running the code
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu

- name: Upload codecoverage
uses: codecov/codecov-action@v3
- name: upload to codecov.io
uses: codecov/codecov-action@v4
with:
files: ./tests/coverage.xml
fail_ci_if_error: true
files: tests/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
11 changes: 5 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Particle-mesh based calculation of Long Distance Equivariants.

For details, tutorials, and examples, please have a look at our `documentation`_.

.. _`documentation`: https://meshlode.readthedocs.io
.. _`documentation`: https://lab-cosmo.github.io/MeshLODE/latest

.. marker-installation
Expand Down Expand Up @@ -53,15 +53,14 @@ Thanks goes to all people that make MeshLODE possible:
.. image:: https://contrib.rocks/image?repo=lab-cosmo/MeshLODE
:target: https://github.com/lab-cosmo/MeshLODE/graphs/contributors

.. |tests| image:: https://github.com/lab-cosmo/MeshLODE/workflows/Test/badge.svg
.. |tests| image:: https://github.com/lab-cosmo/MeshLODE/workflows/Tests/badge.svg
:alt: Github Actions Tests Job Status
:target: (https://github.com/lab-cosmo/MeshLODE/\
actions?query=workflow%3ATests)
:target: https://github.com/lab-cosmo/MeshLODE/actions?query=workflow%3ATests

.. |codecov| image:: https://codecov.io/gh/lab-cosmo/meshlode/branch/main/graph/badge.svg?token=UZJPJG34SM
:alt: Code coverage
:target: https://codecov.io/gh/lab-cosmo/meshlode/

.. |docs| image:: https://img.shields.io/badge/documentation-latest-sucess
:alt: Python
:target: https://meshlode.readthedocs.io
:alt: Documentation
:target: https://lab-cosmo.github.io/MeshLODE/latest

0 comments on commit 41a6330

Please sign in to comment.