fix: add scipy and scikit-learn to dependencies; build whl needs this #1206
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
on: [push, pull_request] | |
name: release-please | |
jobs: | |
linting: | |
name: Linting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install black ruff | |
- name: Autoformat with black | |
run: | | |
black . | |
- name: Lint with ruff | |
run: | | |
ruff check . --fix | |
- name: Check for local changes | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "style: style fixes by ruff and autoformatting by black" | |
fi | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "style: style fixes by ruff and autoformatting by black" | |
continuous-integration: | |
name: Continuous integration ${{ matrix.os }} python ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ${{ fromJSON(vars.BUILD_OS)}} | |
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Installing dependencies | |
shell: bash -l {0} | |
run: | | |
conda install -c loop3d -c conda-forge --file dependencies.txt -y | |
conda install pytest -y | |
- name: Building and install | |
shell: bash -l {0} | |
run: | | |
pip install . | |
- name: Testing | |
shell: bash -l {0} | |
run: | | |
pytest | |
documentation-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
cp CHANGELOG.md docs/source/CHANGELOG.md | |
docker build . -t=docs -f docs/Dockerfile | |
docker run -v $(pwd):/map2loop docs bash map2loop/docs/build_docs.sh | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: docs/build/html | |
conda-build: | |
name: Building conda package for python | |
needs: ["linting"] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
steps: | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
- name: update submodules | |
# shell: bash -l {0} | |
run: | | |
git submodule update --init --recursive | |
- name: Conda build | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
shell: bash -l {0} | |
run: | | |
conda install --solver=classic -c conda-forge conda-build anaconda-client conda-libmamba-solver -y | |
python conda/generate_meta.py | |
conda build -c conda-forge -c loop3d --output-folder conda conda --python ${{ matrix.python-version }} | |
conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: conda-${{ matrix.os }}-${{ matrix.python-version }} | |
path: conda | |
release-please: | |
runs-on: ubuntu-latest | |
needs: continuous-integration | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: GoogleCloudPlatform/release-please-action@v4 | |
id: release | |
with: | |
release-type: python | |
package-name: map2loop | |
include-v-in-tag: false | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
conda-deploy: | |
#runs all the same as the build stage but need to rerun after release created to get updated | |
#tag | |
name: Building conda package for python | |
needs: release-please | |
if: ${{ needs.release-please.outputs.release_created }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
steps: | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
- name: update submodules | |
# shell: bash -l {0} | |
run: | | |
git submodule update --init --recursive | |
- name: Conda build | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
shell: bash -l {0} | |
run: | | |
conda install --solver=classic -c conda-forge conda-build anaconda-client conda-libmamba-solver -y | |
python conda/generate_meta.py | |
conda build -c conda-forge -c loop3d --output-folder conda conda --python ${{ matrix.python-version }} | |
conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda | |
anaconda upload --label main conda/*/*.tar.bz2 | |
documentation-deploy: | |
runs-on: ubuntu-latest | |
needs: release-please | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: docs | |
- name: ls | |
run: | | |
ls -l docs | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: docs # The folder the action should deploy. | |
upload_to_pypi: | |
needs: ["release-please", "conda-deploy"] | |
runs-on: "ubuntu-latest" | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip_existing: true | |
verbose: true | |
user: ${{ secrets.PYPI_USERNAME }} | |
password: ${{ secrets.PYPI_PASSWORD }} |