Add support for PDWF with external projectors #172
Workflow file for this run
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
name: Continuous Integration | |
on: [push, pull_request] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache python dependencies | |
id: cache-pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }} | |
restore-keys: pip-pre-commit- | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: pip install -e .[pre-commit,tests,analysis,dev] | |
- name: Run pre-commit | |
run: pre-commit run || ( git status --short; git diff; exit 1 ) | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
services: | |
postgres: | |
image: postgres:12 | |
ports: | |
- 5432:5432 | |
rabbitmq: | |
image: rabbitmq:latest | |
ports: | |
- 5672:5672 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache python dependencies | |
id: cache-pip | |
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 ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install python dependencies | |
run: pip install -e .[tests] | |
- name: Run pytest | |
run: pytest --cov=aiida_wannier90_workflows --cov-report=xml -sv | |
working-directory: tests | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# secrets and env are not accessible for PR from fork, therefore codecov | |
# would fail during tests. Now ignore failed codecov upload in PR, they | |
# will be uploaded during the test on main branch after PR merge. | |
fail_ci_if_error: false | |
verbose: true | |
working-directory: tests | |
docs: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
steps: | |
- 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 install -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 |