Skip to content

Commit 2e851e0

Browse files
Modify optional workflows to be triggered by comments
1 parent 2acc94d commit 2e851e0

File tree

2 files changed

+164
-56
lines changed

2 files changed

+164
-56
lines changed
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: Comment Commands to Trigger CI
2+
on:
3+
issue_comment:
4+
types: created
5+
6+
permissions:
7+
checks: write
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"
23+
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:
63+
runs-on: ubuntu-latest
64+
timeout-minutes: 10
65+
if: (github.event.issue.pull_request) && github.event.comment.body == '/mypy_nightly'
66+
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Install project dependencies
71+
uses: ./.github/setup
72+
with:
73+
os: ubuntu-latest
74+
python-version: "3.11"
75+
76+
- name: Run mypy tests with mypy nightly
77+
id: tests-step
78+
run: poetry run poe mypy --mypy_nightly
79+
80+
- name: Get head sha and store value
81+
if: always()
82+
id: get-sha
83+
uses: actions/github-script@v7
84+
with:
85+
github-token: ${{ secrets.GITHUB_TOKEN }}
86+
script: |
87+
const pr = await github.rest.pulls.get({
88+
owner: context.repo.owner,
89+
repo: context.repo.repo,
90+
pull_number: ${{ github.event.issue.number }}
91+
})
92+
core.setOutput('sha', pr.data.head.sha)
93+
94+
- name: Report results of the tests and publish
95+
if: always()
96+
uses: actions/github-script@v7
97+
with:
98+
github-token: ${{ secrets.GITHUB_TOKEN }}
99+
script: |
100+
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',
154+
head_sha: '${{ steps.get-sha.outputs.sha }}',
155+
status: 'completed',
156+
conclusion: '${{ steps.tests-step.outcome }}',
157+
output: {
158+
title: 'Run pyright strict tests',
159+
summary: 'Results: ${{ steps.tests-step.outcome }}',
160+
text: 'See the actions run at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
161+
},
162+
owner: context.repo.owner,
163+
repo: context.repo.repo
164+
})

.github/workflows/optional.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)