Skip to content

tests-pip-latest

tests-pip-latest #557

name: tests-pip-latest
on:
pull_request:
paths:
- .github/issue-templates/pip-latest-failure.md
- .github/issue-templates/pip-latest-success.md
- .github/workflows/tests-pip-latest.yml
schedule:
- cron: "0 4 * * *"
jobs:
unit:
strategy:
matrix:
release:
- stable
- pre-release
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup development environment
uses: ./.github/actions/setup-dev-env
- name: Extract current pip version
id: current
run: |
VERSION=`pip show pip | grep Version | sed 's/Version: \(.*\)/\1/'`
echo "${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Upgrade pip and extract version
id: latest
env:
RELEASE: ${{ matrix.release }}
run: |
PRE=`if [[ $RELEASE == 'pre-release' ]]; then echo '--pre'; fi`
python -m pip install --progress-bar=off --upgrade $PRE pip
VERSION=`pip show pip | grep Version | sed 's/Version: \(.*\)/\1/'`
echo "${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Run unit test
id: tests
if: steps.current.outputs.version != steps.latest.outputs.version
run: doit test
- if: failure() && steps.tests.outcome == 'failure'
name: Publish information from template
uses: ./.github/actions/publish-from-template
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
ID: ${{ github.run_id }}
VERSION: ${{ steps.latest.outputs.version }}
with:
filename: .github/issue-templates/pip-latest-failure.md
- if: steps.tests.outcome == 'success' && matrix.release == 'stable'
name: Publish information from template
uses: ./.github/actions/publish-from-template
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
ID: ${{ github.run_id }}
VERSION: ${{ steps.latest.outputs.version }}
with:
filename: .github/issue-templates/pip-latest-success.md