forked from aiidateam/aiida-core
-
Notifications
You must be signed in to change notification settings - Fork 1
175 lines (140 loc) · 4.86 KB
/
ci-code.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: continuous-integration
on:
push:
branches-ignore: [gh-pages]
pull_request:
branches-ignore: [gh-pages]
paths-ignore: ['docs/**']
jobs:
check-requirements:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dm-script dependencies
run: pip install packaging==20.3 click~=7.0 pyyaml~=5.1 tomlkit
- name: Check requirements files
id: check_reqs
run: python ./utils/dependency_management.py check-requirements DEFAULT
- name: Create commit comment
if: failure() && steps.check_reqs.outputs.error
uses: peter-evans/commit-comment@v1
with:
path: setup.json
body: |
${{ steps.check_reqs.outputs.error }}
Click [here](https://github.com/aiidateam/aiida-core/wiki/AiiDA-Dependency-Management) for more information on dependency management.
tests:
needs: [check-requirements]
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
backend: ['django', 'sqlalchemy']
python-version: [3.6, 3.8]
services:
postgres:
image: postgres:10
env:
POSTGRES_DB: test_${{ matrix.backend }}
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt update
sudo apt install postgresql-10 graphviz
- name: Upgrade pip
run: |
pip install --upgrade pip
pip --version
# Work-around issue caused by pymatgen's setup process, which will install the latest
# numpy version (including release candidates) regardless of our actual specification
# By installing the version from the requirements file, we should get a compatible version
- name: Install numpy
run: |
pip install `grep 'numpy==' requirements/requirements-py-${{ matrix.python-version }}.txt`
- name: Install aiida-core
run: |
pip install --use-feature=2020-resolver -r requirements/requirements-py-${{ matrix.python-version }}.txt
pip install --use-feature=2020-resolver --no-deps -e .
reentry scan
pip freeze
- name: Setup environment
env:
AIIDA_TEST_BACKEND: ${{ matrix.backend }}
run:
.github/workflows/setup.sh
- name: Run test suite
env:
AIIDA_TEST_BACKEND: ${{ matrix.backend }}
run:
.github/workflows/tests.sh
- name: Upload coverage report
if: matrix.python-version == 3.6 && github.repository == 'aiidateam/aiida-core'
uses: codecov/codecov-action@v1
with:
name: aiida-pytests-py3.6-${{ matrix.backend }}
flags: ${{ matrix.backend }}
file: ./coverage.xml
fail_ci_if_error: false # don't fail job, if coverage upload fails
verdi:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install python dependencies
run: pip install -e .
- name: Run verdi
run: |
verdi devel check-load-time
.github/workflows/verdi.sh
docker:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Install docker
run: |
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
- name: Build the aiida-core image
run:
docker build -t aiida-core .
- name: Run aiida-core image and test the default aiida profile and localhost computer.
run: |
export DOCKERID=`docker run -d aiida-core`
docker exec --tty $DOCKERID wait-for-services
docker logs $DOCKERID
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'verdi profile show default'
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'verdi computer show localhost'
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'verdi daemon status'