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 1
1
name : Test and lint
2
2
3
3
on :
4
+ schedule :
5
+ - cron : " 0 2 * * *" # 2am UTC
4
6
push :
5
7
branches :
6
8
- main
21
23
tests :
22
24
name : Run tests
23
25
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
+
24
34
strategy :
25
35
fail-fast : false
26
36
matrix :
52
62
linting :
53
63
name : Lint
54
64
65
+ # no reason to run this as a cron job
66
+ if : github.event_name != 'schedule'
67
+
55
68
runs-on : ubuntu-latest
56
69
57
70
steps :
75
88
76
89
- name : Lint tests
77
90
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