-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-35048][INFRA] Distribute GitHub Actions workflows to fork repositories to share the resources #32092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
[SPARK-35048][INFRA] Distribute GitHub Actions workflows to fork repositories to share the resources #32092
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Notify test workflow | ||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened, synchronize] | ||
|
|
||
| jobs: | ||
| notify: | ||
| runs-on: ubuntu-20.04 | ||
| steps: | ||
| - name: "Notify test workflow" | ||
| uses: actions/github-script@v3 | ||
| if: ${{ github.base_ref == 'master' }} | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const endpoint = "GET /repos/:owner/:repo/actions/workflows/:id/runs?&branch=:branch" | ||
| const params = { | ||
| owner: context.payload.pull_request.head.repo.owner.login, | ||
| repo: context.payload.pull_request.head.repo.name, | ||
| id: "build_and_test.yml", | ||
| branch: context.payload.pull_request.head.ref, | ||
| } | ||
| const runs = await github.request(endpoint, params) | ||
| var runID = runs.data.workflow_runs[0].id | ||
| var msg = "**[Test build #" + runID + "]" | ||
| + "(https://github.com/" + context.payload.pull_request.head.repo.full_name | ||
| + "/actions/runs/" + runID + ")** " | ||
| + "for PR " + context.issue.number | ||
| + " at commit [`" + context.payload.pull_request.head.sha.substring(0, 7) + "`]" | ||
| + "(https://github.com/" + context.payload.pull_request.head.repo.full_name | ||
| + "/commit/" + context.payload.pull_request.head.sha + ")." | ||
| github.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.payload.repository.owner.login, | ||
| repo: context.payload.repository.name, | ||
| body: msg | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -656,16 +656,10 @@ def main(): | |
| # If we're running the tests in GitHub Actions, attempt to detect and test | ||
| # only the affected modules. | ||
| if test_env == "github_actions": | ||
| if os.environ["GITHUB_INPUT_BRANCH"] != "": | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maropu FYI. I think we should update https://spark.apache.org/developer-tools.html because now we always run the tests on each commit in each branch in forked repositories.. I will take a look and fix it soon. |
||
| # Dispatched request | ||
| # Note that it assumes GitHub Actions has already merged | ||
| # the given `GITHUB_INPUT_BRANCH` branch. | ||
| if os.environ["APACHE_SPARK_REF"] != "": | ||
| # Fork repository | ||
| changed_files = identify_changed_files_from_git_commits( | ||
| "HEAD", target_branch=os.environ["GITHUB_SHA"]) | ||
| elif os.environ["GITHUB_BASE_REF"] != "": | ||
| # Pull requests | ||
| changed_files = identify_changed_files_from_git_commits( | ||
| os.environ["GITHUB_SHA"], target_branch=os.environ["GITHUB_BASE_REF"]) | ||
| "HEAD", target_ref=os.environ["APACHE_SPARK_REF"]) | ||
| else: | ||
| # Build for each commit. | ||
| changed_files = identify_changed_files_from_git_commits( | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.