Skip to content

Commit

Permalink
switch to github actions (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
ltalirz committed Dec 16, 2019
1 parent 07557d2 commit 18946f9
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 150 deletions.
7 changes: 0 additions & 7 deletions .ci/azure-templates/apt-steps.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .ci/azure-templates/conda-steps.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .ci/azure-templates/pip-steps.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: ci

on: [push, pull_request]

jobs:

tests:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
python-version: [2.7, 3.7]
backend: ['django']
steps:
- uses: actions/checkout@v1
- uses: harmon758/postgresql-action@v1
with:
postgresql version: '11'
postgresql db: test_${{ matrix.backend }}
postgresql user: 'postgres'
postgresql password: ''

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

- name: Install system dependencies
run: |
wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | sudo apt-key add -
echo 'deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
echo 'deb https://dl.bintray.com/rabbitmq/debian bionic main' | sudo tee -a /etc/apt/sources.list.d/bintray.rabbitmq.list
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install postgresql postgresql-server-dev-all postgresql-client rabbitmq-server graphviz
sudo systemctl status rabbitmq-server.service
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[testing]
reentry scan -r aiida
- name: Run test suite
env:
AIIDA_TEST_BACKEND: ${{ matrix.backend }}
# show timings of tests
PYTEST_ADDOPTS: "--durations=0"
run: py.test --cov aiida_diff --cov-append .

docs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[docs]
reentry scan -r aiida
- name: Build docs
run: cd docs && make

pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -e .[pre-commit,docs,testing]
reentry scan -r aiida
- name: Run pre-commit
run: |
pre-commit install
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ matrix:
python: 3.6
env:
TEST_TYPE: docs
READTHEDOCS: 'True'
- name: "python-3.6 (pre-commit)"
python: 3.6
env:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/aiidateam/aiida-diff.svg?branch=master)](https://travis-ci.org/aiidateam/aiida-diff)
[![Build Status](https://github.com/aiidateam/aiida-diff/workflows/ci/badge.svg?branch=master)](https://travis-ci.org/aiidateam/aiida-diff/actions)
[![Coverage Status](https://coveralls.io/repos/github/aiidateam/aiida-diff/badge.svg?branch=master)](https://coveralls.io/github/aiidateam/aiida-diff?branch=master)
[![Docs status](https://readthedocs.org/projects/aiida-diff/badge)](http://aiida-diff.readthedocs.io/)
[![PyPI version](https://badge.fury.io/py/aiida-diff.svg)](https://badge.fury.io/py/aiida-diff)
Expand All @@ -18,7 +18,7 @@ Plugins templated using the plugin cutter
* include basic regression tests using the [pytest](https://docs.pytest.org/en/latest/) framework ( (submitting a calculation, ...)
* can be directly pip-installed (and are prepared for submisson to [PyPI](https://pypi.org/)
* include a documentation template ready for [Read the Docs](http://aiida-diff.readthedocs.io/en/latest/)
* come with [Travis CI](https://travis-ci.org) configuration - enable it to run tests and check test coverage at every commit
* come with [Github Actions](https://github.com/features/actions) configuration - enable it to run tests and check test coverage at every commit
* come with pre-commit hooks that sanitize coding style and check for syntax errors - enable via `pre-commit install`

For more information on how to take advantage of these features,
Expand Down
82 changes: 0 additions & 82 deletions azure-pipelines.yml

This file was deleted.

50 changes: 20 additions & 30 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import time
import aiida_diff

from aiida.manage import configuration
from aiida.manage.manager import get_manager

# -- AiiDA-related setup --------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -25,32 +28,21 @@
# Enable rtd mode via `export READTHEDOCS=True`
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
# No sphinx_rtd_theme installed
pass
# Load the database environment by first loading the profile and then loading the backend through the manager
from aiida.manage.configuration import get_config, load_profile
from aiida.manage.manager import get_manager
config = get_config()
load_profile(config.default_profile_name)
get_manager().get_backend()
if on_rtd: # let RTD set the theme
pass
else:
# Back-end settings for readthedocs online documentation.
from aiida.manage import configuration
from aiida.manage.manager import get_manager
configuration.IN_RT_DOC_MODE = True
configuration.BACKEND = "django"

configuration.reset_config(
) # empty config was created when importing aiida
configuration.load_profile() # load dummy config for RTD
# load DB backend (no schema check since no DB)
get_manager()._load_backend(schema_check=False) # pylint: disable=protected-access
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Back-end settings for readthedocs online documentation.
configuration.IN_RT_DOC_MODE = True
configuration.BACKEND = "django"

configuration.reset_config() # empty config was created when importing aiida
configuration.load_profile() # load dummy config for RTD
# load DB backend (no schema check since no DB)
get_manager()._load_backend(schema_check=False) # pylint: disable=protected-access

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -162,11 +154,9 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#~ html_theme_options = {
#~ 'inner_theme': True,
#~ 'inner_theme_name': 'bootswatch-darkly',
#~ 'nav_fixed_top': False
#~ }
html_theme_options = {
'display_version': True,
}

# Add any paths that contain custom themes here, relative to this directory.
#~ html_theme_path = ["."]
Expand Down
1 change: 1 addition & 0 deletions examples/submit.py → examples/example_01.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""Submit a test calculation on localhost.
Usage: verdi run submit.py
Expand Down
12 changes: 6 additions & 6 deletions setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
],
"extras_require": {
"testing": [
"pgtest==1.3.1",
"wheel>=0.31",
"pgtest~=1.3.1",
"wheel~=0.31",
"coverage",
"pytest>=3.6.3,<5.0.0",
"pytest-cov>=2.6.1,<5.0.0"
"pytest~=3.6,<5.0.0",
"pytest-cov"
],
"pre-commit": [
"astroid==1.6.6; python_version<'3.0'",
Expand All @@ -54,9 +54,9 @@
],
"docs": [
"sphinx",
"sphinx-rtd-theme",
"sphinxcontrib-contentui",
"sphinxcontrib-details-directive; python_version>='3.0'"
"sphinxcontrib-details-directive; python_version>='3.0'",
"sphinx-rtd-theme"
]
}
}

0 comments on commit 18946f9

Please sign in to comment.