Skip to content

Commit

Permalink
github-actions/pnl-install: Check if a newly bumped dependency is rol…
Browse files Browse the repository at this point in the history
…led back during installation

Signed-off-by: Jan Vesely <[email protected]>
  • Loading branch information
jvesely committed Apr 19, 2022
1 parent 1e01666 commit 55f57ef
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/actions/install-pnl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ runs:
[[ ${{ runner.os }} = Windows* ]] && pip install "pywinpty<1" "terminado<0.10"
fi
- name: Install updated package
if: ${{ startsWith(github.head_ref, 'dependabot/pip') }}
shell: bash
id: new_package
run: |
export NEW_PACKAGE=`echo '${{ github.head_ref }}' | cut -f 4 -d/ | sed 's/-gt.*//' | sed 's/-lt.*//'`
echo "::set-output name=new_package::$NEW_PACKAGE"
pip install "`grep $NEW_PACKAGE requirements*.txt | head -n1`"
pip show "$NEW_PACKAGE" | grep 'Version' | tee new_version.deps
- name: Python dependencies
shell: bash
run: |
Expand All @@ -66,3 +76,10 @@ runs:
pip cache remove -v $P || true
fi
done
- name: Check updated package
if: ${{ startsWith(github.head_ref, 'dependabot/pip') }}
shell: bash
run: |
pip show ${{ steps.new_package.outputs.new_package }} | grep 'Version' | tee installed_version.deps
diff new_version.deps installed_version.deps || echo "::error Package version restricted by dependencies: ${{ steps.new_package.outputs.new_package }}"

0 comments on commit 55f57ef

Please sign in to comment.