build #88
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
name: build | |
on: | |
push: | |
schedule: | |
- cron: 0 8 * * 6 | |
jobs: | |
pip: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 3 | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} with uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies and package | |
run: uv sync --all-extras --group test | |
- name: Test with pytest | |
run: uv run pytest | |
minimal: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.8" | |
- name: Install package and dependencies | |
run: pip install . pandas pytest | |
- name: Test with pytest | |
run: pytest | |
latest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install package with extras | |
run: pip install ".[all]" pytest | |
- name: Test with pytest | |
run: pytest | |
package: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python with uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: "3.10" | |
- name: Package | |
run: uv build | |
- name: Publish package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
run: uv publish --token ${{ secrets.PYPI_TOKEN }} | |
conda-build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: s-weigand/setup-conda@v1 | |
- name: Set up build system | |
run: | | |
conda install -y -c conda-forge boa anaconda-client | |
conda config --set anaconda_upload no | |
- name: Run conda build | |
run: conda mambabuild ci/conda_recipe -c conda-forge -c robostack | |
- name: Upload to channel on tags | |
if: startsWith(github.ref, 'refs/tags/') | |
run: anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u phausamann /usr/share/miniconda/conda-bld/noarch/rigid-body-motion*.tar.bz2 --force | |
docs: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python with uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: "3.10" | |
- name: Install pandoc | |
run: sudo apt-get install -y pandoc | |
- name: Install dependencies and package | |
run: uv sync --all-extras --group docs | |
- name: Build Sphinx docs and run doctests | |
env: | |
NBSPHINX_EXEC: always | |
run: | | |
uv run sphinx-build -b html docs docs/_build/html | |
uv run sphinx-build -b doctest docs docs/_build/html | |
touch docs/_build/html/.nojekyll | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python with uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: uv sync --no-install-workspace --group lint | |
- name: Check black code style | |
run: uv run black --check . | |
- name: Lint with flake8 | |
run: uv run flake8 rigid_body_motion tests --ignore=E203,W503,W504 --exclude=**/externals | |
- name: Run isort | |
run: uv run isort -c . |