Skip to content

Commit

Permalink
Merge branch 'main' into issue_1449
Browse files Browse the repository at this point in the history
  • Loading branch information
slayoo authored Dec 14, 2024
2 parents 5c39180 + bcb51e0 commit bbafca0
Show file tree
Hide file tree
Showing 20 changed files with 667 additions and 162 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/pdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: pdoc

defaults:
run:
shell: bash

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'

jobs:
pdoc:
strategy:
matrix:
platform: [ ubuntu-latest, macos-13, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4.1.6
with:
submodules: recursive
persist-credentials: false
- uses: actions/setup-python@v5.0.0
with:
python-version: "3.12"
- run: |
pip install pdoc nbformat
pip install -e .
pip install -e examples
python - <<EOF
import glob, nbformat
for notebook_path in glob.glob('examples/PySDM_examples/*/*.ipynb'):
with open(notebook_path, encoding="utf8") as fin:
with open(notebook_path + ".badges.md", 'w') as fout:
fout.write(nbformat.read(fin, nbformat.NO_CONVERT).cells[0].source)
EOF
PDOC_ALLOW_EXEC=1 python -We -m pdoc -o html PySDM examples/PySDM_examples -t docs/templates --math --mermaid
- if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }}
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: pdoc
folder: html
clean: true
19 changes: 19 additions & 0 deletions .github/workflows/projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Add new issues and pull requests to project board

on:
issues:
types:
- opened
pull_request:
types:
- opened

jobs:
add-to-project:
name: Add to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/open-atmos/projects/6
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
97 changes: 97 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: pypi

defaults:
run:
shell: bash

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'
release:
types: [published]

jobs:
package:
strategy:
matrix:
packages-dir: [ ".", "examples" ]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.6
with:
submodules: recursive
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
- uses: actions/setup-python@v5.0.0
with:
python-version: "3.12"

- run: pip install twine build

- run: |
unset CI
cd ${{ matrix.packages-dir }}
python -m build 2>&1 | tee build.log
exit `fgrep -i warning build.log | grep -v impl_numba/warnings.py \
| grep -v "no previously-included files matching" \
| grep -v "version of {dist_name} already set" \
| grep -v -E "UserWarning: version of PySDM(-examples)? already set" \
| wc -l`
twine check --strict dist/*
- uses: actions/upload-artifact@v4
with:
path: ${{ matrix.packages-dir }}/dist
name: dist-${{ matrix.packages-dir }}

pkg_install_check:
strategy:
matrix:
platform: [ ubuntu-latest, macos-13, macos-14, windows-latest ]
python-version: [ "3.9", "3.12" ]
exclude:
- platform: macos-14
python-version: "3.9"
runs-on: ${{ matrix.platform }}
needs: [ package ]
steps:
- uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist
- run: python -m pip install $PIP_INSTALL_ARGS dist/*.whl
- run: python -c "import PySDM; print(PySDM.__version__)"
- run: python -c "import PySDM_examples; print(PySDM_examples.__version__)"

publish:
runs-on: ubuntu-latest
needs: [ package, pkg_install_check ]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist

- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1.12
with:
attestations: false
repository_url: https://test.pypi.org/legacy/
packages-dir: dist

- if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1.12
with:
attestations: false
packages-dir: dist
Loading

0 comments on commit bbafca0

Please sign in to comment.