Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/extended.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,38 @@ on:
push:
branches:
- main
issue_comment:
types: [created]

permissions:
pull-requests: write

jobs:
# Check issue comment and notify that extended tests are running
check_issue_comment:
name: Check issue comment
runs-on: ubuntu-latest
if: github.event.issue.pull_request && github.event.comment.body == 'run extended tests'
steps:
- uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can create a check in the PR to show that the running the tests is in progress,

we can use https://octokit.github.io/rest.js/v21/#checks

to create a check if the comment is available,

and when the pipeline runs, we can update the check using the update the check

octokit.rest.checks.update({
        owner,
repo,
check_run_id,
output.summary,
output.annotations[].path,
output.annotations[].start_line,
output.annotations[].end_line,
output.annotations[].annotation_level,
output.annotations[].message,
output.images[].alt,
output.images[].image_url,
actions[].label,
actions[].description,
actions[].identifier
      })

see in the docs that I have linked the "Update a check run" under the checks api

wdyt @alamb ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using other actions in an apache repo is problematic as I previously found out. However, it's not hard to have an action post a comment and then edit it to show progress.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it in my fork, see this PR:

It seems to have worked great

Screenshot 2025-01-29 at 12 26 18 PM

Here is the workflow run:
https://github.com/alamb/datafusion/actions/runs/13036912907

I am going to wait to see what happens on success and then I will purposely introduce a failure in extended tests and see what happens

issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Running extended tests..."
})
# Check crate compiles and base cargo check passes
linux-build-lib:
name: linux build test
runs-on: ubuntu-latest
container:
image: amd64/rust
if: |
github.event_name == 'push' ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests')
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
Expand All @@ -55,6 +79,9 @@ jobs:
runs-on: ubuntu-latest
container:
image: amd64/rust
if: |
github.event_name == 'push' ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests')
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -75,6 +102,9 @@ jobs:
runs-on: ubuntu-latest
container:
image: amd64/rust
if: |
github.event_name == 'push' ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests')
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -94,6 +124,9 @@ jobs:
runs-on: ubuntu-latest
container:
image: amd64/rust
if: |
github.event_name == 'push' ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests')
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -105,3 +138,49 @@ jobs:
rust-version: stable
- name: Run sqllogictest
run: cargo test --profile release-nonlto --test sqllogictests -- --include-sqlite

notify_if_run_on_pr_success:
name: Notify
runs-on: ubuntu-latest
needs:
[
linux-test-extended,
hash-collisions,
sqllogictest-sqlite,
check_issue_comment,
]
if: success()
steps:
- uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "extended test suite ran successfully on this PR."
})

notify_if_run_on_pr_failure:
name: Notify
runs-on: ubuntu-latest
needs:
[
linux-test-extended,
hash-collisions,
sqllogictest-sqlite,
check_issue_comment,
]
if: failure()
steps:
- uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "extended test suite failed on this PR."
})