-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (61 loc) · 1.71 KB
/
main.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
name: chimedb_dataflag-ci-build
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
lint-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install black
run: pip install black
- name: Check code with black
run: |
black --check .
run-tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: test
ports:
- 32574:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Update apt-get
run: sudo apt-get update
- name: Install apt dependencies
run: |
sudo apt-get install -y libopenmpi-dev libhdf5-serial-dev
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install pytest and future and dateutil
run: |
pip install pytest future python-dateutil git+https://github.com/chime-experiment/ch_util.git
- name: Install chimedb_dataflags
run: |
pip install .
- name: Run tests
# Set PYTHONPATH so that relative imports in click script work when pytest imports that
run: PYTHONPATH=. pytest -s tests