Updated dependencies and Allan deviation analysis names #405
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build on supported Pythons | |
# | |
# Closely watch version references for actions! | |
name: Python build | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Build Python package | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12.6"] | |
env: | |
PY_LATEST: "3.12.6" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up R (release) | |
# They tell us to use master (ambiguously) | |
uses: r-lib/actions/setup-r@v2 | |
- name: Install system requirements | |
run: | | |
sudo apt-get install libcurl4-openssl-dev ffmpeg | |
- name: Install diveMove | |
run: | | |
install.packages('diveMove') | |
shell: Rscript {0} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Python requirements | |
run: | | |
python -m pip install --upgrade pip setuptools build twine | |
- name: Build binary wheel and source tarball | |
run: | | |
python -m build | |
twine check dist/* | |
- name: Test and coverage | |
run: | | |
python -m pip install --upgrade .['test'] | |
coverage run --branch -m pytest skdiveMove | |
coverage xml | |
- name: Upload coverage | |
uses: codecov/codecov-action@v4 | |
if: matrix.python-version == env.PY_LATEST | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
fail_ci_if_error: true | |
- name: Build Sphinx docs | |
if: matrix.python-version == env.PY_LATEST | |
run: | | |
python -m pip install --upgrade .['dev'] | |
python -m ipykernel install --user | |
make -C docs/ html | |
touch docs/build/html/.nojekyll | |
- name: Upload products | |
uses: actions/upload-artifact@v4 | |
if: | |
(matrix.python-version == env.PY_LATEST) && | |
startsWith(github.ref, 'refs/tags') | |
with: | |
name: dist-pkg | |
path: | | |
dist | |
docs/build | |
deploy: | |
# No matrix here, so just test for tag. Runs on every tag, so artifact | |
# expected from "build" | |
name: Deploy to GitHub Pages | |
if: startsWith(github.ref, 'refs/tags') | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Download products | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-pkg | |
- name: Publish GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: docs/build/html | |
publish: | |
name: Publish Python distribution to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
needs: [build, deploy] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/scikit-diveMove | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download products | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-pkg | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |