forked from paris-saclay-cds/ramp-board
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (114 loc) · 3.93 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
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
name: main
on:
push:
pull_request:
workflow_dispatch:
inputs:
ramp_workflow_url:
description: 'pip installable ramp-workflow repo URL'
required: true
default: 'https://github.com/paris-saclay-cds/ramp-workflow/archive/refs/heads/master.zip'
jobs:
main:
name: test-py-${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python: ["3.7", "3.8", "3.9", "3.10"]
include:
- os: ubuntu-20.04
python: 3.8
# the following has no effect with manual trigger
# where the ramp-workflow is specified anyway
ramp_workflow_version: master
services:
postgres:
image: postgres:11.6-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
# Add a health check
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
activate-conda: false
python-version: ${{ matrix.python }}
conda-channels: anaconda
- name: Create envs
run: |
conda install --yes mamba -n base -c conda-forge
rm -f /usr/share/miniconda/pkgs/cache/*.json # workaround for mamba-org/mamba#488
mamba create --yes -n testenv python=$PYTHON_VERSION
mamba env update -n testenv -f environment.yml
mamba env create -f ci_tools/environment_iris_kit.yml
env:
PYTHON_VERSION: ${{ matrix.python }}
- name: Install ramp-board
run: |
source activate testenv
if [ "$PYTHON_VERSION" == "3.8" ]; then
python -m pip install "dask==2021.4.1" "distributed==2021.4.1"
fi
if [ "${{ matrix.ramp_workflow_version }}" == "master" ]; then
pip install https://github.com/paris-saclay-cds/ramp-workflow/archive/refs/heads/master.zip
fi
if [ "${{ github.event.inputs.ramp_workflow_url }}" != "" ]; then
pip install "${{ github.event.inputs.ramp_workflow_url }}"
fi
make inplace
env:
PYTHON_VERSION: ${{ matrix.python }}
- name: Test ramp-frontend
run: |
set -e
source activate testenv
python -m smtpd -n -c DebuggingServer 127.0.0.1:8025 &
sleep 3 # wait for the server to start
pytest -rvsl ramp-frontend --cov=ramp_frontend --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-engine
run: |
set -e
source activate testenv
pytest -rvsl ramp-engine/ --cov=ramp_engine --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-database
run: |
set -e
source activate testenv
pytest -rvsl ramp-database/ --cov=ramp_database --cov-report=term-missing --cov-report=xml --cov-append
- name: Test ramp-utils
run: |
set -e
source activate testenv
pytest -rvsl ramp-utils/ --cov=ramp_utils --cov-report=term-missing --cov-report=xml --cov-append
- name: Test integration
run: |
set -e
source activate testenv
bash ci_tools/actions/integration_test.sh
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
file: ./coverage.xml
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.7'
- name: Install dependencies
run: pip install flake8 black==22.3.0
- name: Run flake8
run: flake8 ramp-*
- name: Run black
run: black --check .