File tree Expand file tree Collapse file tree 2 files changed +379
-0
lines changed
Expand file tree Collapse file tree 2 files changed +379
-0
lines changed Original file line number Diff line number Diff line change 11name : Test and lint
22
33on :
4+ schedule :
5+ - cron : " 0 2 * * *" # 2am UTC
46 push :
57 branches :
68 - main
2123 tests :
2224 name : Run tests
2325
26+ if : >-
27+ # if 'schedule' was the trigger,
28+ # don't run it on contributors' forks
29+ ${{
30+ github.repository == 'python/typing_extensions'
31+ || github.event_name != 'schedule'
32+ }}
33+
2434 strategy :
2535 fail-fast : false
2636 matrix :
5262 linting :
5363 name : Lint
5464
65+ # no reason to run this as a cron job
66+ if : github.event_name != 'schedule'
67+
5568 runs-on : ubuntu-latest
5669
5770 steps :
7588
7689 - name : Lint tests
7790 run : flake8 --config=.flake8-tests src/test_typing_extensions.py --color always
91+
92+ create-issue-on-failure :
93+ name : Create an issue if daily tests failed
94+ runs-on : ubuntu-latest
95+
96+ needs : [tests]
97+
98+ if : >-
99+ ${{
100+ github.repository == 'python/typing_extensions'
101+ && always()
102+ && github.event_name == 'schedule'
103+ && needs.tests.result == 'failure'
104+ }}
105+
106+ permissions :
107+ issues : write
108+
109+ steps :
110+ - uses : actions/github-script@v6
111+ with :
112+ github-token : ${{ secrets.GITHUB_TOKEN }}
113+ script : |
114+ await github.rest.issues.create({
115+ owner: "python",
116+ repo: "typing_extensions",
117+ title: `Daily tests failed on ${new Date().toDateString()}`,
118+ body: "Runs listed here: https://github.com/python/typing_extensions/actions/workflows/ci.yml",
119+ })
You can’t perform that action at this time.
0 commit comments