44 pull_request :
55 branches :
66 - main
7- - ' release/**'
7+ - " release/**"
88 - develop
99 paths :
10- - ' ads/**'
10+ - " ads/**"
1111 - setup.py
12- - ' **requirements.txt'
12+ - " **requirements.txt"
13+ - .github/workflows/run-unittests.yml
14+ - .github/workflows/run-unittests-default_setup.yml
1315
1416# Cancel in progress workflows on pull_requests.
1517# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -85,22 +87,21 @@ jobs:
8587 shell : bash
8688 run : |
8789 set -x # print commands that are executed
88-
90+
8991 sudo apt-get install libkrb5-dev graphviz
9092 $CONDA/bin/conda init
9193 source /home/runner/.bashrc
92-
94+
9395 pip install -r dev-requirements.txt
9496
9597 - name : " Run unitary tests folder with maximum ADS dependencies"
9698 timeout-minutes : 60
9799 shell : bash
98100 env :
99- NB_SESSION_COMPARTMENT_OCID : ocid1.compartment.oc1.<unique_ocid>
100101 CONDA_PREFIX : /usr/share/miniconda
101102 run : |
102103 set -x # print commands that are executed
103-
104+
104105 # Setup project and tests folder for cov reports to not be overwritten by another parallel step
105106 if [[ ! -z "${{ matrix.cov-reports }}" ]]; then
106107 mkdir -p cov-${{ matrix.name }}
@@ -109,7 +110,7 @@ jobs:
109110 ln -s ../ads ads
110111 ln -s ../.coveragerc .coveragerc
111112 fi
112-
113+
113114 # Run tests
114115 python -m pytest -v -p no:warnings --durations=5 \
115116 -n auto --dist loadfile ${{ matrix.cov-reports }} \
@@ -145,18 +146,18 @@ jobs:
145146 - name : " Calculate overall coverage"
146147 run : |
147148 set -x # print commands that are executed
148-
149+
149150 # Prepare default cov body text
150151 COV_BODY_INTRO="📌 Overall coverage:\n\n"
151152 echo COV_BODY="$COV_BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
152-
153+
153154 # Combine coverage files
154155 pip install coverage
155156 coverage combine cov-reports-unitary/.coverage cov-reports-model/.coverage
156-
157+
157158 # Make html report
158159 coverage html
159-
160+
160161 # Calculate overall coverage and update body message
161162 COV=$(grep -E 'pc_cov' htmlcov/index.html | cut -d'>' -f 2 | cut -d'%' -f 1)
162163 if [[ ! -z $COV ]]; then
@@ -168,18 +169,18 @@ jobs:
168169 if : always()
169170 run : |
170171 set -x # print commands that are executed
171-
172+
172173 # Prepare default diff body text
173174 DIFF_BODY_INTRO="📌 Cov diff with **${{ env.COMPARE_BRANCH }}**:\n\n"
174175 echo DIFF_BODY="$DIFF_BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
175-
176+
176177 # Prepare file paths to coverage xml files
177178 # Filenames taken from job.test last step with name - "Save coverage files"
178179 FILE1="cov-reports-unitary/coverage.xml"; [[ ! -f $FILE1 ]] && FILE1=""
179180 FILE2="cov-reports-model/coverage.xml"; [[ ! -f $FILE2 ]] && FILE2=""
180181 echo "FILE1=$FILE1" >> $GITHUB_ENV
181182 echo "FILE2=$FILE2" >> $GITHUB_ENV
182-
183+
183184 # Calculate coverage diff and update body message
184185 pip install diff_cover
185186 diff-cover $FILE1 $FILE2 --compare-branch=origin/${{ env.COMPARE_BRANCH }}
0 commit comments