Merge pull request #67 from jcapriot/prism_cython #374
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"] | |
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 | |
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: Install Our Package | |
run: | | |
export BUILD_GEOANA_EXT=1 | |
pip install -e . | |
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.10' | |
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 | |
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: | | |
export BUILD_GEOANA_EXT=1 | |
python setup.py sdist | |
- 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: | | |
export BUILD_GEOANA_EXT=1 | |
pip install -e . | |
- 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 }} |