Pyproject.toml #378
Workflow file for this run
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: TestingWithConda | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build_and_test: | |
name: Testing (${{ matrix.python-version }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-name: geoana-test | |
create-args: >- | |
python=${{ matrix.python-version }} | |
numpy>=1.20 | |
scipy>=1.8 | |
libdlf | |
cython | |
setuptools_scm | |
meson-python>=0.14.0 | |
meson | |
ninja | |
build | |
discretize | |
matplotlib | |
jupyter | |
utm | |
pytest | |
pytest-cov | |
sphinx | |
sphinx-gallery>=0.1.13 | |
pydata-sphinx-theme=0.13.3 | |
numpydoc>=1.5 | |
graphviz | |
pillow | |
cache-environment: true | |
- name: Install numba | |
if: matrix.python-version != '3.12' | |
# Numba doesn't work on python 3.12 just yet, so conditionally install it into the environment: | |
run: | | |
micromamba install numba | |
- name: Install Our Package | |
run: | | |
pip install --no-build-isolation --editable . --config-settings=setup-args="-Dwith_extensions=true" | |
conda list | |
- name: Run Tests | |
run: | | |
pytest --cov-config=.coveragerc --cov=geoana --cov-report=xml -s -v -W ignore::DeprecationWarning | |
- name: "Upload coverage to Codecov" | |
if: matrix.python-version == '3.11' | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
distribute: | |
name: Publish Source to Pypi | |
needs: build_and_test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-name: geoana-test | |
create-args: >- | |
python=3.10 | |
numpy>=1.20 | |
scipy>=1.8 | |
libdlf | |
cython | |
setuptools_scm | |
meson-python>=0.14.0 | |
meson | |
ninja | |
build | |
discretize | |
matplotlib | |
jupyter | |
utm | |
numba | |
pytest | |
pytest-cov | |
sphinx | |
sphinx-gallery>=0.1.13 | |
pydata-sphinx-theme=0.13.3 | |
numpydoc>=1.5 | |
graphviz | |
pillow | |
cache-environment: true | |
- name: Prepare source distribution | |
run: | | |
python -m build --no-isolation --skip-dependency-check --sdist . --config-settings=setup-args="-Dwith_extensions=true" | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true | |
- name: Install package | |
run: | | |
pip install --no-build-isolation --editable . --config-settings=setup-args="-Dwith_extensions=true" | |
- name: Build documentation | |
run: | | |
cd docs | |
make html | |
cd .. | |
- name: GitHub Pages | |
# You may pin to the exact commit or the version. | |
uses: crazy-max/[email protected] | |
with: | |
# Git domain (default github.com) | |
# domain: # optional, default is github.com | |
# GitHub repository where assets will be deployed (default $GITHUB_REPOSITORY) | |
# repo: # optional | |
# Git branch where assets will be deployed | |
# target_branch: # optional, default is gh-pages | |
# Create incremental commit instead of doing push force | |
# keep_history: # optional, default is false | |
# Allow an empty commit to be created | |
# allow_empty_commit: # optional, default is true | |
# Build directory to deploy | |
build_dir: docs/_build/html | |
# The committer name and email address | |
# committer: # optional | |
# The author name and email address | |
# author: # optional | |
# Commit message | |
# commit_message: # optional | |
# Write the given domain name to the CNAME file | |
fqdn: geoana.simpeg.xyz | |
# Allow Jekyll to build your site | |
jekyll: false # optional, default is true | |
# If enabled, nothing will be pushed | |
# dry_run: true # optional, default is false | |
# Enable verbose output | |
# verbose: true # optional, default is false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |