-
Notifications
You must be signed in to change notification settings - Fork 18
114 lines (89 loc) · 2.79 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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.11"
- name: Install dependencies
run: pip install -e .[pre-commit,tests,analysis]
- 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.8", "3.9", "3.10", "3.11"]
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 }}
fail_ci_if_error: true
verbose: true
working-directory: tests
docs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
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