Skip to content

Commit

Permalink
Update github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaojunfeng committed Jul 3, 2023
1 parent 6f6c32c commit e26be99
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 280 deletions.
27 changes: 0 additions & 27 deletions .ci/install_script.sh

This file was deleted.

174 changes: 92 additions & 82 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,111 @@
name: Continuous Integration
on: [push, pull_request]

jobs:
docs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
install-type: [docs]
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-${{ matrix.install-type }}-${{ hashFiles('**/setup.json')
}}
restore-keys: pip-${{ matrix.python-version }}-${{ matrix.install-type }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install the python project
env:
INSTALL_TYPE: ${{ matrix.install-type }}
run: .ci/install_script.sh
- name: Build documentation
env:
READTHEDOCS: 'True'
run: SPHINXOPTS='-nW' make -C docs html
- uses: actions/upload-artifact@v2
with:
name: doc-build
path: docs/build/html
pre-commit:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8]
install-type: [dev_precommit]
python-version: [3.11]

steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-${{ matrix.install-type }}-${{ hashFiles('**/setup.json')
}}
restore-keys: pip-${{ matrix.python-version }}-${{ matrix.install-type }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install the python project
env:
INSTALL_TYPE: ${{ matrix.install-type }}
run: .ci/install_script.sh
- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1
)
- name: Checkout code
uses: actions/checkout@v3

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: pip-pre-commit-${{ matrix.python-version }}

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

- name: Install the python project
run: pip install -e .[pre-commit]

- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short; git diff; exit 1 )

tests:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
install-type: [testing]
include:
- python-version: 3.8
install-type: testing_sdist
python-version: [3.8, 3.9, 3.10, 3.11]

services:
postgres:
image: postgres:10
image: postgres:12
ports:
- 5432:5432
- 5432:5432
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672
- 5672:5672

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

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-tests-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: pip-tests-${{ matrix.python-version }}

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

- name: Install the python project
run: pip install -e .[tests]

- name: Run pytest
run: pytest --cov=aiida_wannier90 --cov-report=xml --cov-config=.coveragerc
working-directory: tests

- name: Upload coverage data
run: codecov --file tests/coverage.xml

docs:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.11]

steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-${{ matrix.install-type }}-${{ hashFiles('**/setup.json')
}}
restore-keys: pip-${{ matrix.python-version }}-${{ matrix.install-type }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install the python project
env:
INSTALL_TYPE: ${{ matrix.install-type }}
run: .ci/install_script.sh
- name: Run pytest
run: pytest --cov=aiida_wannier90 --cov-report=xml --cov-config=.coveragerc
working-directory: tests
- name: Upload coverage data
if: ${{ matrix.install-type == 'testing' }}
run: codecov --file tests/coverage.xml
- name: Checkout code
uses: actions/checkout@v3

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-docs-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: pip-docs-${{ matrix.python-version }}

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

- name: Install the python project
run: pip intall -e .[docs]

- name: Build documentation
env:
READTHEDOCS: "True"
run: SPHINXOPTS='-nW' make -C docs html

- uses: actions/upload-artifact@v3
with:
name: doc-build
path: docs/build/html
90 changes: 0 additions & 90 deletions .github/workflows_source/ci.yml

This file was deleted.

21 changes: 4 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ repos:
- id: check-toml

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.8.0
hooks:
- id: pyupgrade
args: ["--py37-plus"]

- repo: https://github.com/ikamensh/flynt/
rev: "0.77"
rev: "0.78"
hooks:
- id: flynt
args: ["--line-length=120", "--fail-on-change"]
Expand All @@ -43,7 +43,7 @@ repos:
additional_dependencies: ["toml"]

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black

Expand All @@ -59,21 +59,8 @@ repos:
args: ["--ignore=D104,D202,D203,D213"]

- repo: https://github.com/PyCQA/pylint
rev: v2.16.2
rev: v3.0.0a6
hooks:
- id: pylint
language: system
exclude: *exclude_pyfiles

- repo: local
hooks:
- id: interpolate-workflows
name: Interpolate Github workflows
entry: python ./utils/interpolate_yaml_anchors.py
language: system
files: |
(?x)^(
.github/(.)*|
utils/interpolate_yaml_anchors.py
)$
pass_filenames: false
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ formats: []

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
version: 3.11
install:
- method: pip
path: .
Expand Down
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v2.1.0

## New features

- Support AiiDA v2.0 [[#117]](https://github.com/aiidateam/aiida-wannier90/issues/117)

# v2.0.1

## Fixes and general improvements
Expand Down Expand Up @@ -33,9 +39,9 @@

- General update of the documentation to include all new changes [[#91]](https://github.com/aiidateam/aiida-wannier90/pull/91) [[#52]](https://github.com/aiidateam/aiida-wannier90/pull/52)

- Use aiida calcjob directive in documentation [[#86]](https://github.com/aiidateam/aiida-wannier90/pull/86)
- Use aiida calcjob directive in documentation [[#86]](https://github.com/aiidateam/aiida-wannier90/pull/86)

- Example of GaAs wannierization (both as a single submission, and via a workchain using Quantum ESPRESSO) [[#77]](https://github.com/aiidateam/aiida-wannier90/pull/77) [[#84]](https://github.com/aiidateam/aiida-wannier90/pull/84)

# v1.0.0
First working version of the plugin
First working version of the plugin
Loading

0 comments on commit e26be99

Please sign in to comment.