Skip to content

Commit

Permalink
add workflow to test ltt against the latest pip version (#70)
Browse files Browse the repository at this point in the history
* add workflow to test ltt against the latest pip version

* fix

* automatically open issues when running on a schedule

* cleanup
  • Loading branch information
pmeier authored May 5, 2022
1 parent 7294b73 commit 3a37760
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/pip_latest_failure_issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Unit tests fail with `pip=={{ env.VERSION }}`
assignees: pmeier
---

See https://github.com/{{ env.REPO }}/actions/runs/{{ env.ID }} for details.
6 changes: 6 additions & 0 deletions .github/pip_latest_suceeded_issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Include `pip=={{ env.VERSION }}` in the supported versions
assignees: pmeier
---

Unit tests succeeded in https://github.com/{{ env.REPO }}/actions/runs/{{ env.ID }}.
70 changes: 70 additions & 0 deletions .github/workflows/tests-pip-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: tests-pip-latest

on:
pull_request:
paths:
- ".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@v2
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 "::set-output name=version::${VERSION}"
- 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 -qqq --upgrade $PRE pip
VERSION=`pip show pip | grep Version | sed 's/Version: \(.*\)/\1/'`
echo "${VERSION}"
echo "::set-output name=version::${VERSION}"
- name: Run unit test
if: steps.current.outputs.version != steps.latest.outputs.version
run: doit test

- uses: JasonEtco/create-an-issue@v2.6.0
if: github.event_name == 'schedule' && failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.latest.outputs.version }}
with:
filename: .github/pip_latest_failure_issue_template.md
update_existing: false

- uses: JasonEtco/create-an-issue@v2.6.0
if: github.event_name == 'schedule' && success() && matrix.release == 'stable'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.latest.outputs.version }}
with:
filename: .github/pip_latest_success_issue_template.md
update_existing: false

0 comments on commit 3a37760

Please sign in to comment.