Skip to content

Commit

Permalink
Merge pull request #42 from molssi-seamm/dev
Browse files Browse the repository at this point in the history
Updating to the standard SEAMM workflows for GitHub actions
  • Loading branch information
seamm authored Jan 27, 2023
2 parents 68c17e5 + 38d5e95 commit fb88c50
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 226 deletions.
48 changes: 6 additions & 42 deletions .github/workflows/BranchCI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,11 @@ on:
push:
branches-ignore:
- 'main'
- 'master'

jobs:
light-ci:
name: Lint ubuntu-latest Py3.9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run linters
shell: bash -l {0}
run: |
black --extend-exclude '_version.py' --check --diff read_structure_step tests
flake8 read_structure_step tests
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=read_structure_step --cov-report=xml --color=yes tests/
- name: CodeCov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
flags: unittests
name: codecov-ubuntu-latest-py3.9

branch-ci:
name: Branch CI
uses: molssi-seamm/devops/.github/workflows/BranchCI.yaml@main
with:
src : read_structure_step
81 changes: 5 additions & 76 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,81 +7,10 @@ on:
pull_request:
branches:
- "main"
schedule:
# Run by default Sunday morning at 3:30:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "30 3 * * 0"

jobs:
lint:
name: Lint ubuntu-latest Py3.9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run linters
shell: bash -l {0}
run: |
black --extend-exclude '_version.py' --check --diff read_structure_step tests
flake8 read_structure_step tests
test:
name: Test ${{ matrix.os }} Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v1
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=read_structure_step --cov-report=xml --color=yes tests/
- name: CodeCov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
ci:
name: CI
uses: molssi-seamm/devops/.github/workflows/CI.yaml@main
with:
src : read_structure_step
114 changes: 6 additions & 108 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,111 +7,9 @@ on:
- "main"

jobs:
lint:
name: Lint ubuntu-latest Py3.9
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run linters
shell: bash -l {0}
run: |
black --extend-exclude '_version.py' --check --diff read_structure_step tests
flake8 read_structure_step tests
test:
name: Test ${{ matrix.os }} Py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v1
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=read_structure_step --cov-report=xml --color=yes tests/
- name: CodeCov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}

deploy:
name: PyPi ubuntu-latest Py3.9
# Run only for tagged releases publishing development or release candidates
# only to test.pypi, otherwise to both it and the main pypi.
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/
ls -l dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish distribution 📦 to PyPI
if: contains(github.ref, 'dev') == false && contains(github.ref, 'rc') == false
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
release:
name: Release
uses: molssi-seamm/devops/.github/workflows/Release.yaml@main
with:
src : read_structure_step
secrets: inherit
16 changes: 16 additions & 0 deletions docs/_static/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Static Doc Directory

Add any paths that contain custom static files (such as style sheets) here,
relative to the `conf.py` file's directory.
They are copied after the builtin static files,
so a file named "default.css" will overwrite the builtin "default.css".

The path to this folder is set in the Sphinx `conf.py` file in the line:
```python
templates_path = ['_static']
```

## Examples of file to add to this directory
* Custom Cascading Style Sheets
* Custom JavaScript code
* Static logo images
Binary file added docs/_static/SEAMM inverted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/SEAMM logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/molssi_main_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/molssi_main_logo_inverted_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/molssi_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/nsf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/_templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Templates Doc Directory

Add any paths that contain templates here, relative to
the `conf.py` file's directory.
They are copied after the builtin template files,
so a file named "page.html" will overwrite the builtin "page.html".

The path to this folder is set in the Sphinx `conf.py` file in the line:
```python
html_static_path = ['_templates']
```

## Examples of file to add to this directory
* HTML extensions of stock pages like `page.html` or `layout.html`
44 changes: 44 additions & 0 deletions docs/_templates/molssi_footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{% if not theme_logo.get("link") %}
{% set href = pathto(root_doc) %}
{% elif hasdoc(theme_logo.get("link")) %}
{% set href = pathto(theme_logo.get("link")) %} {# internal page #}
{% else %}
{% set href = theme_logo.get("link") %} {# external url #}
{% endif %}

{# get all the brand information from html_theme_option #}
{% set is_logo = logo or theme_logo.get("image_light") or theme_logo.get("image_dark") %}
{% set image_light = theme_logo.get("molssi_light") or logo %}
{% set image_dark = theme_logo.get("molssi_dark") or logo %}
{% set image_light = image_light if image_light.startswith("http") else pathto('_static/' + image_light, 1) %}
{% set image_dark = image_dark if image_dark.startswith("http") else pathto('_static/' + image_dark, 1) %}
{% set alt = theme_logo.get("alt_text", "Logo image") %}
{% set nsf_logo = pathto('_static/' + 'nsf.png', 1) %}


<div class="row h-10">
<div class="col-2">
<a href="https://molssi.org/" target="_blank" title="Go to MolSSI in a new tab">
<img src="{{ image_light }}" class="logo__image only-light footer_logo" alt="{{ alt }}">
<img src="{{ image_dark }}" class="logo__image only-dark footer_logo" alt="{{ alt }}">
</a>
</div>
<div class="col-8">
<p> &copy; Copyright 2019-2023 <a href="https://molssi.org/">The Molecular Sciences Software Institute</a></p>
<p>Funded by the National Science Foundation
<a href="https://nsf.gov/awardsearch/showAward?AWD_ID=1547580">OAC-1547580</a> and
<a href="https://www.nsf.gov/awardsearch/showAward?AWD_ID=2136142">CHE-2136142.</a></p>

{% if show_sphinx %}
<p class="sphinx-version">
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}<br>
</p>
{% endif %}

</div>
<div class="col-2">
<a href="https://nsf.gov/" target="_blank" title="Go to the NSF in a new tab">
<img src="{{ nsf_logo }}" class="footer_logo" alt="The NSF">
</a>
</div>
</div>

0 comments on commit fb88c50

Please sign in to comment.