Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a cron job for testing third-party users of typing_extensions #206

Merged
merged 9 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test and lint

on:
schedule:
- cron: "0 2 * * *" # 2am UTC
push:
branches:
- main
Expand All @@ -21,6 +23,14 @@ jobs:
tests:
name: Run tests

if: >-
# if 'schedule' was the trigger,
# don't run it on contributors' forks
${{
github.repository == 'python/typing_extensions'
|| github.event_name != 'schedule'
}}

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -51,6 +61,9 @@ jobs:
linting:
name: Lint

# no reason to run this as a cron job
if: github.event_name != 'schedule'

runs-on: ubuntu-latest

steps:
Expand All @@ -74,3 +87,32 @@ jobs:

- name: Lint tests
run: flake8 --config=.flake8-tests src/test_typing_extensions.py --color always

create-issue-on-failure:
name: Create an issue if daily tests failed
runs-on: ubuntu-latest

needs: [tests]

if: >-
${{
github.repository == 'python/typing_extensions'
&& always()
&& github.event_name == 'schedule'
&& needs.tests.result == 'failure'
}}

permissions:
issues: write

steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.create({
owner: "python",
repo: "typing_extensions",
title: `Daily tests failed on ${new Date().toDateString()}`,
body: "Runs listed here: https://github.com/python/typing_extensions/actions/workflows/ci.yml",
})
Loading