4
4
push :
5
5
branches :
6
6
- main
7
- - ' release/**'
7
+ - " release/**"
8
8
- develop
9
9
paths :
10
- - ' ads/**'
10
+ - " ads/**"
11
11
- setup.py
12
- - ' **requirements.txt'
13
- - ' !docs/**'
12
+ - " **requirements.txt"
13
+ - " !docs/**"
14
14
15
15
pull_request :
16
16
@@ -88,22 +88,21 @@ jobs:
88
88
shell : bash
89
89
run : |
90
90
set -x # print commands that are executed
91
-
91
+
92
92
sudo apt-get install libkrb5-dev graphviz
93
93
$CONDA/bin/conda init
94
94
source /home/runner/.bashrc
95
-
95
+
96
96
pip install -r dev-requirements.txt
97
97
98
98
- name : " Run unitary tests folder with maximum ADS dependencies"
99
99
timeout-minutes : 60
100
100
shell : bash
101
101
env :
102
- NB_SESSION_COMPARTMENT_OCID : ocid1.compartment.oc1.<unique_ocid>
103
102
CONDA_PREFIX : /usr/share/miniconda
104
103
run : |
105
104
set -x # print commands that are executed
106
-
105
+
107
106
# Setup project and tests folder for cov reports to not be overwritten by another parallel step
108
107
if [[ ! -z "${{ matrix.cov-reports }}" ]]; then
109
108
mkdir -p cov-${{ matrix.name }}
@@ -112,7 +111,7 @@ jobs:
112
111
ln -s ../ads ads
113
112
ln -s ../.coveragerc .coveragerc
114
113
fi
115
-
114
+
116
115
# Run tests
117
116
python -m pytest -v -p no:warnings --durations=5 \
118
117
-n auto --dist loadfile ${{ matrix.cov-reports }} \
@@ -148,18 +147,18 @@ jobs:
148
147
- name : " Calculate overall coverage"
149
148
run : |
150
149
set -x # print commands that are executed
151
-
150
+
152
151
# Prepare default cov body text
153
152
COV_BODY_INTRO="📌 Overall coverage:\n\n"
154
153
echo COV_BODY="$COV_BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
155
-
154
+
156
155
# Combine coverage files
157
156
pip install coverage
158
157
coverage combine cov-reports-unitary/.coverage cov-reports-model/.coverage
159
-
158
+
160
159
# Make html report
161
160
coverage html
162
-
161
+
163
162
# Calculate overall coverage and update body message
164
163
COV=$(grep -E 'pc_cov' htmlcov/index.html | cut -d'>' -f 2 | cut -d'%' -f 1)
165
164
if [[ ! -z $COV ]]; then
@@ -171,18 +170,18 @@ jobs:
171
170
if : always()
172
171
run : |
173
172
set -x # print commands that are executed
174
-
173
+
175
174
# Prepare default diff body text
176
175
DIFF_BODY_INTRO="📌 Cov diff with **${{ env.COMPARE_BRANCH }}**:\n\n"
177
176
echo DIFF_BODY="$BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
178
-
177
+
179
178
# Prepare file paths to coverage xml files
180
179
# Filenames taken from job.test last step with name - "Save coverage files"
181
180
FILE1="cov-reports-unitary/coverage.xml"; [[ ! -f $FILE1 ]] && FILE1=""
182
181
FILE2="cov-reports-model/coverage.xml"; [[ ! -f $FILE2 ]] && FILE2=""
183
182
echo "FILE1=$FILE1" >> $GITHUB_ENV
184
183
echo "FILE2=$FILE2" >> $GITHUB_ENV
185
-
184
+
186
185
# Calculate coverage diff and update body message
187
186
pip install diff_cover
188
187
diff-cover $FILE1 $FILE2 --compare-branch=origin/${{ env.COMPARE_BRANCH }}
0 commit comments