-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ericpre/add_github_actions
Add GitHub actions
- Loading branch information
Showing
6 changed files
with
171 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Docs | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_doc: | ||
name: Build docs | ||
runs-on: ubuntu-latest | ||
env: | ||
BUILD_DEPS: python3-dev build-essential graphviz | ||
LATEX_DEPS: dvipng latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: ericpre/sphinx-action@latest_sphinx | ||
with: | ||
pre-build-command: "apt-get update -y && apt-get install -y ${{ env.BUILD_DEPS }} ${{ env.LATEX_DEPS }} && pip install .'[all, docs]'" | ||
build-command: make html | ||
docs-folder: docs/ | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./docs/_build/html/ | ||
name: docs_build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
run_test_site: | ||
name: ${{ matrix.os }}-py${{ matrix.PYTHON_VERSION }}${{ matrix.LABEL }} | ||
runs-on: ${{ matrix.os }}-latest | ||
timeout-minutes: 30 | ||
env: | ||
MPLBACKEND: agg | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, windows, macos] | ||
PYTHON_VERSION: ['3.8', '3.9'] | ||
PIP_SELECTOR: ['[all, tests]'] | ||
include: | ||
# test oldest supported version of main dependencies on python 3.6 | ||
- os: ubuntu | ||
PYTHON_VERSION: '3.7' | ||
OLDEST_SUPPORTED_VERSION: true | ||
DEPENDENCIES: matplotlib==3.1.3 numpy==1.17.1 scipy==1.1 imagecodecs==2020.1.31 tifffile==2020.2.16 dask==2.11.0 distributed==2.11.0 numba==0.52 | ||
PIP_SELECTOR: '[all, tests]' | ||
LABEL: -oldest | ||
# test minimum requirement | ||
- os: ubuntu | ||
PYTHON_VERSION: '3.8' | ||
PIP_SELECTOR: '[tests]' | ||
LABEL: -minimum | ||
- os: ubuntu | ||
PYTHON_VERSION: '3.7' | ||
PIP_SELECTOR: '[all, tests]' | ||
- os: ubuntu | ||
PYTHON_VERSION: '3.10' | ||
PIP_SELECTOR: '[all, tests]' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v3 | ||
name: Install Python | ||
with: | ||
python-version: ${{ matrix.PYTHON_VERSION }} | ||
|
||
- name: Display version | ||
run: | | ||
python --version | ||
pip --version | ||
- name: Install oldest supported version | ||
if: ${{ matrix.OLDEST_SUPPORTED_VERSION }} | ||
run: | | ||
pip install ${{ matrix.DEPENDENCIES }} | ||
- name: Install | ||
shell: bash | ||
run: | | ||
pip install --upgrade -e .'${{ matrix.PIP_SELECTOR }}' | ||
- name: Install (HyperSpy dev) | ||
# Need to install hyperspy dev until hyperspy 2.0 is released | ||
shell: bash | ||
run: | | ||
pip install https://github.com/hyperspy/hyperspy/archive/refs/heads/RELEASE_next_major.zip | ||
- name: Pip list | ||
run: | | ||
pip list | ||
- name: Run test suite | ||
run: | | ||
pytest --pyargs rsciio --reruns 3 -n 2 --cov=. --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
if: ${{ always() }} | ||
uses: codecov/codecov-action@v2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
/docs/_build/* | ||
/docs/_build/* | ||
/build/* | ||
/RosettaSciIO.egg-info/* | ||
*__pycache__* | ||
*test_compilers.obj | ||
*pyd |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
formats: | ||
- htmlzip | ||
|
||
python: | ||
version: 3.10 | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[build-system] | ||
requires = ["setuptools>=49.0", "wheel", "cython", "pyyaml"] | ||
build-backend = "setuptools.build_meta:__legacy__" | ||
|
||
[tool.pytest.ini_options] | ||
# Note we may need to use `-n 2` argument for pytest-xdist on CI | ||
# due to https://github.com/pytest-dev/pytest-xdist/issues/9. | ||
addopts = "-ra -n auto --dist loadfile" | ||
minversion = "6.0" | ||
testpaths = [ | ||
"rsciio/tests", | ||
] |
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