-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.81 KB
/
Copy pathci.yml
File metadata and controls
64 lines (53 loc) · 1.81 KB
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
name: CI
on: pull_request
jobs:
code_analysis:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Flake8
run: flake8 . --exclude=*/__init__.py,.eggs/,build/,osp-core/ --docstring-convention=google
- name: Radon
run: |
radon cc -s -a .,
radon mi -s .
- name: bandit
run: bandit -r osp --skip B101
test:
runs-on: ubuntu-latest
services:
db:
image: postgres:11.7
env:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "123-postgres"
POSTGRES_DB: "postgres"
POSTGRES_HOST: "db"
ports:
- 5432:5432
steps:
- name: Checkout wrapper code
uses: actions/checkout@v2
- name: Checkout osp-core
uses: actions/checkout@v2
with:
repository: simphony/osp-core
path: osp-core
- name: Install matching osp-core
run: |
OSP_CORE_MIN=$(python -c "import packageinfo; print(packageinfo.OSP_CORE_MIN)")
OSP_CORE_MAX=$(python -c "import packageinfo; print(packageinfo.OSP_CORE_MAX)")
verlte() { [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]; }
verlt() { [ "$1" = "$2" ] && return 1 || verlte $1 $2; }
cd osp-core
OSP_CORE_VERSION=$(python -c "import packageinfo; print(packageinfo.VERSION)")
if ! (verlte $OSP_CORE_MIN $OSP_CORE_VERSION && verlt $OSP_CORE_VERSION $OSP_CORE_MAX) ; then
git checkout "tags/v${OSP_CORE_MIN}-beta" || git checkout "v${OSP_CORE_MIN}-dev";
fi
pip install .
pico install city
- name: unittesting
run: |
pip install coverage
coverage run setup.py test
coverage report --omit=osp-core/*,tests/*,*/.eggs/* --skip-covered