6
6
permissions :
7
7
checks : write
8
8
9
- jobs :
10
- pandas_nightly :
11
- runs-on : ubuntu-latest
12
- timeout-minutes : 10
13
- if : (github.event.issue.pull_request) && github.event.comment.body == '/pandas_nightly'
14
-
15
- steps :
16
- - uses : actions/checkout@v4
17
-
18
- - name : Install project dependencies
19
- uses : ./.github/setup
20
- with :
21
- os : ubuntu-latest
22
- python-version : " 3.11"
9
+ env :
10
+ RUN_COMMAND : ' {"/pandas_nightly": "pytest --nightly", "/pyright_strict": "pyright_strict", "/mypy_nightly": "mypy --mypy_nightly"}'
11
+ DISPLAY_COMMAND : ' {"/pandas_nightly": "Pandas nightly tests", "/pyright_strict": "Pyright strict tests", "/mypy_nightly": "Mypy nightly tests"}'
23
12
24
- - name : Run pytest (against pandas nightly)
25
- id : tests-step
26
- run : poetry run poe pytest --nightly
27
-
28
- - name : Get head sha and store value
29
- if : always()
30
- id : get-sha
31
- uses : actions/github-script@v7
32
- with :
33
- github-token : ${{ secrets.GITHUB_TOKEN }}
34
- script : |
35
- const pr = await github.rest.pulls.get({
36
- owner: context.repo.owner,
37
- repo: context.repo.repo,
38
- pull_number: ${{ github.event.issue.number }}
39
- })
40
- core.setOutput('sha', pr.data.head.sha)
41
- #
42
- - name : Report results of the tests and publish
43
- if : always()
44
- uses : actions/github-script@v7
45
- with :
46
- github-token : ${{ secrets.GITHUB_TOKEN }}
47
- script : |
48
- github.rest.checks.create({
49
- name: 'Pandas nightly tests',
50
- head_sha: '${{ steps.get-sha.outputs.sha }}',
51
- status: 'completed',
52
- conclusion: '${{ steps.tests-step.outcome }}',
53
- output: {
54
- title: 'Run pandas nightly tests',
55
- summary: 'Results: ${{ steps.tests-step.outcome }}',
56
- text: 'See the actions run at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
57
- },
58
- owner: context.repo.owner,
59
- repo: context.repo.repo
60
- })
61
-
62
- mypy_nightly :
13
+ jobs :
14
+ optional_tests :
15
+ name : " Optional tests run"
63
16
runs-on : ubuntu-latest
64
17
timeout-minutes : 10
65
- if : (github.event.issue.pull_request) && github.event.comment.body == '/mypy_nightly'
18
+ if : (github.event.issue.pull_request) && contains(fromJSON('["/pandas_nightly", "/pyright_strict", "/mypy_nightly"]'), github.event.comment.body)
66
19
67
20
steps :
68
21
- uses : actions/checkout@v4
73
26
os : ubuntu-latest
74
27
python-version : " 3.11"
75
28
76
- - name : Run mypy tests with mypy nightly
29
+ - name : Run ${{ fromJSON(env.DISPLAY_COMMAND)[github.event.comment.body] }}
77
30
id : tests-step
78
- run : poetry run poe mypy --mypy_nightly
31
+ run : poetry run poe ${{ fromJSON(env.RUN_COMMAND)[github.event.comment.body] }}
79
32
80
33
- name : Get head sha and store value
81
34
if : always()
@@ -98,66 +51,14 @@ jobs:
98
51
github-token : ${{ secrets.GITHUB_TOKEN }}
99
52
script : |
100
53
github.rest.checks.create({
101
- name: 'Mypy nightly tests',
102
- head_sha: '${{ steps.get-sha.outputs.sha }}',
103
- status: 'completed',
104
- conclusion: '${{ steps.tests-step.outcome }}',
105
- output: {
106
- title: 'Run mypy nightly tests',
107
- summary: 'Results: ${{ steps.tests-step.outcome }}',
108
- text: 'See the actions run at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
109
- },
110
- owner: context.repo.owner,
111
- repo: context.repo.repo
112
- })
113
-
114
- pyright_strict :
115
- runs-on : ubuntu-latest
116
- timeout-minutes : 10
117
- if : (github.event.issue.pull_request) && github.event.comment.body == '/pyright_strict'
118
-
119
- steps :
120
- - uses : actions/checkout@v4
121
-
122
- - name : Install project dependencies
123
- uses : ./.github/setup
124
- with :
125
- os : ubuntu-latest
126
- python-version : " 3.11"
127
-
128
- - name : Run pyright tests with full strict mode
129
- id : tests-step
130
- run : poetry run poe pyright_strict
131
-
132
- - name : Get head sha and store value
133
- if : always()
134
- id : get-sha
135
- uses : actions/github-script@v7
136
- with :
137
- github-token : ${{ secrets.GITHUB_TOKEN }}
138
- script : |
139
- const pr = await github.rest.pulls.get({
140
- owner: context.repo.owner,
141
- repo: context.repo.repo,
142
- pull_number: ${{ github.event.issue.number }}
143
- })
144
- core.setOutput('sha', pr.data.head.sha)
145
- #
146
- - name : Report results of the tests and publish
147
- if : always()
148
- uses : actions/github-script@v7
149
- with :
150
- github-token : ${{ secrets.GITHUB_TOKEN }}
151
- script : |
152
- github.rest.checks.create({
153
- name: 'Pyright strict tests',
54
+ name: '${{ fromJSON(env.DISPLAY_COMMAND)[github.event.comment.body] }}',
154
55
head_sha: '${{ steps.get-sha.outputs.sha }}',
155
56
status: 'completed',
156
57
conclusion: '${{ steps.tests-step.outcome }}',
157
58
output: {
158
- title: 'Run pyright strict tests ',
59
+ title: 'Run ${{ fromJSON(env.DISPLAY_COMMAND)[github.event.comment.body] }} ',
159
60
summary: 'Results: ${{ steps.tests-step.outcome }}',
160
- text: 'See the actions run at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
61
+ text: 'See the actions run at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
161
62
},
162
63
owner: context.repo.owner,
163
64
repo: context.repo.repo
0 commit comments