Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging for a new release #188

Merged
merged 8 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 81 additions & 11 deletions .github/workflows/cd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,98 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Conda with Python 3.8
uses: conda-incubator/setup-miniconda@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
auto-update-conda: true
python-version: 3.8
auto-activate-base: false
python-version: ${{ matrix.python-version }}

- name: Check Python Version
run: python --version

- name: Install Package Dependencies
shell: bash -l {0}
run: |
python --version
python -m pip install --upgrade pip
python -m pip install nose nose-exclude coverage pycodestyle
python -m pip install -r develop.txt

- name: Install PySAP
run: python -m pip install .

- name: Run Tests
shell: bash -l {0}
run: |
python setup.py nosetests
run: python -m pytest

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: unittests

api:
name: Deploy API Documentation
needs: coverage
runs-on: ubuntu-latest
if: success()

env:
gh_root: https://github.com/CEA-COSMIC/
tag_path: /archive/refs/tags/
sphinx_opts: -t docs/_templates -feTMo docs/source

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Check Python Version
run: python --version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pandoc
python -m pip install -r docs/requirements.txt
python -m pip install .

- name: Download plug-ins
if: ${{ inputs.build_plugins }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
plugin_version="$(echo ${_plugin} | awk -F== '{print $2}')"
wget ${gh_root}${plugin_name}${tag_path}${plugin_version}.tar.gz -O ${plugin_name}.tar.gz
done < plugins.txt
for file in *.tar.gz; do tar xzf "$file"; done
rm *.tar.gz

- name: Extract plug-in examples
if: ${{ inputs.build_examples }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
cp -r ${plugin_name}-*/examples examples/${plugin_name} || echo "Warning: no examples found for ${plugin_name}"
done < plugins.txt

- name: Build PySAP source files
run: sphinx-apidoc ${sphinx_opts} pysap

- name: Build plug-in source files
if: ${{ inputs.build_plugins }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
package_name="$(echo ${plugin_name} | awk -F- '{print $2}')"
sphinx-apidoc ${sphinx_opts} ${plugin_name}-*/${package_name}
done < plugins.txt

- name: Build API documentation
run: sphinx-build -E docs/source docs/_build

- name: Deploy API documentation
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build
86 changes: 86 additions & 0 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Check Docs Manually

on:
workflow_dispatch:
inputs:
build_plugins:
description: 'Build API Docs with Plug-Ins'
required: true
default: true
type: boolean
build_examples:
description: 'Build API Docs with Examples'
required: true
default: true
type: boolean

jobs:

api:
name: Check API Documentation
runs-on: ubuntu-latest

env:
gh_root: https://github.com/CEA-COSMIC/
tag_path: /archive/refs/tags/
sphinx_opts: -t docs/_templates -feTMo docs/source

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Check Python Version
run: python --version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pandoc
python -m pip install -r docs/requirements.txt
python -m pip install .

- name: Download plug-ins
if: ${{ inputs.build_plugins }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
plugin_version="$(echo ${_plugin} | awk -F== '{print $2}')"
wget ${gh_root}${plugin_name}${tag_path}${plugin_version}.tar.gz -O ${plugin_name}.tar.gz
done < plugins.txt
for file in *.tar.gz; do tar xzf "$file"; done
rm *.tar.gz

- name: Extract plug-in examples
if: ${{ inputs.build_examples }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
cp -r ${plugin_name}-*/examples examples/${plugin_name} || echo "Warning: no examples found for ${plugin_name}"
done < plugins.txt

- name: Build PySAP source files
run: sphinx-apidoc ${sphinx_opts} pysap

- name: Build plug-in source files
if: ${{ inputs.build_plugins }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
package_name="$(echo ${plugin_name} | awk -F- '{print $2}')"
sphinx-apidoc ${sphinx_opts} ${plugin_name}-*/${package_name}
done < plugins.txt

- name: Build API documentation
run: sphinx-build -E docs/source docs/_build

- name: Archive API build
uses: actions/upload-artifact@v2
with:
name: api-docs
retention-days: 14
path: docs/_build
78 changes: 38 additions & 40 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,63 +16,55 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8]
python-version: ["3.10"]

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Conda with Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
auto-activate-base: false

- name: Check Conda
shell: bash -l {0}
run: |
conda info
conda list
python --version
- name: Check Python Version
run: python --version

- name: Install macOS Dependencies
shell: bash -l {0}
if: runner.os == 'macOS'
run: |
brew install libomp
brew tap sfarrens/sf
brew install bigmac libomp

- name: Install Package Dependencies
shell: bash -l {0}
run: |
python --version
python -m pip install --upgrade pip
python -m pip install nose nose-exclude coverage pycodestyle
python -m pip install -r develop.txt
python -m pip install twine

- name: Run Tests
shell: bash -l {0}
- name: Install PySAP
run: python -m pip install .

- name: Check PySAP Installation
run: |
python setup.py nosetests
pycodestyle pysap --ignore="E121,E123,E126,E226,E24,E704,E402,E731,E722,E741,W503,W504,W605"
pycodestyle examples --ignore="E121,E123,E126,E226,E24,E704,E402,E731,E741,W503,W504,W605"
python -c "import pysparse"
python -c "import pysap; print(pysap.info())"

- name: Run Tests
run: python -m pytest

- name: Save Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: unit-test-results-${{ matrix.os }}-${{ matrix.python-version }}
path: nosetests.xml
path: pytest.xml

- name: Run Examples
continue-on-error: true
shell: bash -l {0}
run: |
python -m pip install .
python pysap/test/test_examples.py
run: python pysap/test/test_examples.py

- name: Check Distribution
shell: bash -l {0}
run: |
python setup.py sdist
twine check dist/*
Expand All @@ -92,33 +84,39 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.9]
python-version: ["3.7", "3.8", "3.9"]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Conda with Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
auto-activate-base: false

- name: Check Python Version
run: python --version

- name: Install macOS Dependencies
shell: bash -l {0}
if: runner.os == 'macOS'
run: |
brew install libomp
brew tap sfarrens/sf
brew install bigmac libomp

- name: Install Package Dependencies
shell: bash -l {0}
run: |
python --version
python -m pip install --upgrade pip
python -m pip install nose nose-exclude coverage pycodestyle
python -m pip install -r develop.txt

- name: Run Tests
shell: bash -l {0}
- name: Install PySAP
run: python -m pip install .

- name: Check PySAP Installation
run: |
python setup.py nosetests
python -c "import pysparse"
python -c "import pysap; print(pysap.info())"

- name: Run Tests
run: python -m pytest
Loading
Loading