From 41a63301e88a3774d668d6f4f0a899b2e7620df4 Mon Sep 17 00:00:00 2001 From: Philip Loche Date: Thu, 29 Feb 2024 17:47:00 +0100 Subject: [PATCH] infrastructure updates * enable codecov * use github pages for docs * update gh actions --- .github/workflows/build.yml | 6 ++--- .github/workflows/docs.yml | 46 ++++++++++++++++++------------------- .github/workflows/lint.yml | 6 ++--- .github/workflows/tests.yml | 24 +++++++++++-------- README.rst | 11 ++++----- 5 files changed, 48 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b0963d5..608be0e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6b091c37..e67768c5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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: | @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9db6584e..53a22c58 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e62e8bef..e61104cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 }} diff --git a/README.rst b/README.rst index df0f0ac8..7088ef7e 100644 --- a/README.rst +++ b/README.rst @@ -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 @@ -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