Skip to content

Commit edb4807

Browse files
committed
Attempting to fix apache#14331
1 parent cecf6dc commit edb4807

File tree

1 file changed

+94
-4
lines changed

1 file changed

+94
-4
lines changed

.github/workflows/extended.yml

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,47 @@ on:
3333
push:
3434
branches:
3535
- main
36+
issue_comment:
37+
types: [ created ]
38+
39+
permissions:
40+
pull-requests: write
3641

3742
jobs:
43+
# Check issue comment and notify that extended tests are running
44+
check_issue_comment:
45+
name: Check issue comment
46+
runs-on: ubuntu-latest
47+
if: github.event.issue.pull_request && github.event.comment.body == 'run extended tests'
48+
steps:
49+
- uses: actions/github-script@v7
50+
with:
51+
github-token: ${{secrets.GITHUB_TOKEN}}
52+
script: |
53+
github.rest.issues.createComment({
54+
issue_number: context.issue.number,
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
body: "Running extended tests..."
58+
})
59+
3860
# Check crate compiles and base cargo check passes
3961
linux-build-lib:
4062
name: linux build test
4163
runs-on: ubuntu-latest
4264
container:
4365
image: amd64/rust
66+
if: |
67+
github.event_name == 'push' ||
68+
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests')
4469
steps:
4570
- uses: actions/checkout@v4
71+
with:
72+
# Check out the pull request if triggered by a comment
73+
ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request.head.sha || github.ref }}
74+
repository: ${{ github.event.pull_request.head.repo.full_name }}
75+
submodules: true
76+
fetch-depth: 1
4677
- name: Setup Rust toolchain
4778
uses: ./.github/actions/setup-builder
4879
with:
@@ -59,9 +90,15 @@ jobs:
5990
runs-on: ubuntu-latest
6091
container:
6192
image: amd64/rust
93+
if: |
94+
github.event_name == 'push' ||
95+
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests')
6296
steps:
6397
- uses: actions/checkout@v4
6498
with:
99+
# Check out the pull request if triggered by a comment
100+
ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request.head.sha || github.ref }}
101+
repository: ${{ github.event.pull_request.head.repo.full_name }}
65102
submodules: true
66103
fetch-depth: 1
67104
- name: Setup Rust toolchain
@@ -81,9 +118,15 @@ jobs:
81118
runs-on: ubuntu-latest
82119
container:
83120
image: amd64/rust
121+
if: |
122+
github.event_name == 'push' ||
123+
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests')
84124
steps:
85125
- uses: actions/checkout@v4
86126
with:
127+
# Check out the pull request if triggered by a comment
128+
ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request.head.sha || github.ref }}
129+
repository: ${{ github.event.pull_request.head.repo.full_name }}
87130
submodules: true
88131
fetch-depth: 1
89132
- name: Setup Rust toolchain
@@ -94,25 +137,72 @@ jobs:
94137
run: |
95138
cd datafusion
96139
cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-sqllogictest --workspace --lib --tests --features=force_hash_collisions,avro,extended_tests
97-
cargo clean
98140
99141
sqllogictest-sqlite:
100142
name: "Run sqllogictests with the sqlite test suite"
101143
runs-on: ubuntu-latest
102144
container:
103145
image: amd64/rust
146+
if: |
147+
github.event_name == 'push' ||
148+
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests')
104149
steps:
105150
- uses: actions/checkout@v4
106151
with:
152+
# Check out the pull request if triggered by a comment
153+
ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request.head.sha || github.ref }}
154+
repository: ${{ github.event.pull_request.head.repo.full_name }}
107155
submodules: true
108156
fetch-depth: 1
109157
- name: Setup Rust toolchain
110158
uses: ./.github/actions/setup-builder
111159
with:
112160
rust-version: stable
113161
- name: Run sqllogictest
114-
run: |
115-
cargo test --profile release-nonlto --test sqllogictests -- --include-sqlite
116-
cargo clean
162+
run: cargo test --profile release-nonlto --test sqllogictests -- --include-sqlite
117163

164+
notify_if_run_on_pr_success:
165+
name: Notify
166+
runs-on: ubuntu-latest
167+
needs:
168+
[
169+
linux-test-extended,
170+
hash-collisions,
171+
sqllogictest-sqlite,
172+
check_issue_comment,
173+
]
174+
if: success()
175+
steps:
176+
- uses: actions/github-script@v7
177+
with:
178+
github-token: ${{secrets.GITHUB_TOKEN}}
179+
script: |
180+
github.rest.issues.createComment({
181+
issue_number: context.issue.number,
182+
owner: context.repo.owner,
183+
repo: context.repo.repo,
184+
body: "extended test suite ran successfully on this PR."
185+
})
118186
187+
notify_if_run_on_pr_failure:
188+
name: Notify
189+
runs-on: ubuntu-latest
190+
needs:
191+
[
192+
linux-test-extended,
193+
hash-collisions,
194+
sqllogictest-sqlite,
195+
check_issue_comment,
196+
]
197+
if: failure()
198+
steps:
199+
- uses: actions/github-script@v7
200+
with:
201+
github-token: ${{secrets.GITHUB_TOKEN}}
202+
script: |
203+
github.rest.issues.createComment({
204+
issue_number: context.issue.number,
205+
owner: context.repo.owner,
206+
repo: context.repo.repo,
207+
body: "extended test suite failed on this PR."
208+
})

0 commit comments

Comments
 (0)