Skip to content

Commit 9d19bf8

Browse files
committed
test every commit in turn in the PR
1 parent 2fc6dfb commit 9d19bf8

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,30 @@ jobs:
255255
diff-quality --violations=pylint --fail-under=90 pylint_report.txt
256256
- name: Verify that intermediate commits are testable
257257
if: ${{ github.event.pull_request }}
258+
env:
259+
PYTHON_VERSION: ${{ matrix.python-version }}
260+
BASE_REF: ${{ github.event.pull_request.base.ref }}
258261
run: |
259-
echo $GITHUB_SHA
260-
echo $GITHUB_REF
261-
262+
BASE_DIR="$(pwd)"
263+
echo BASE_REF: $BASE_REF
264+
echo GITHUB_SHA: $GITHUB_SHA
265+
echo GITHUB_REF: $GITHUB_REF
266+
git fetch origin $BASE_REF
267+
COMMIT_RANGE=origin/$BASE_REF..$GITHUB_SHA
268+
echo COMMIT_RANGE: $COMMIT_RANGE
269+
echo Will test the following commits:
270+
git log --oneline --reverse $COMMIT_RANGE
271+
for i in $(git log --pretty=format:%H --reverse $COMMIT_RANGE); do
272+
git checkout $i
273+
make clean
274+
if [[ $PYTHON_VERSION == '2.6' ]]; then
275+
unit2 discover || exit 1
276+
else
277+
python -m unittest discover || exit 1
278+
fi
279+
make test-local || exit 1
280+
cd "$BASE_DIR"
281+
done
262282
- name: Publish coverage to Coveralls
263283
env:
264284
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

0 commit comments

Comments
 (0)