forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Switch to PR Reviews for triggering CI (vectordotdev#20892)
* chore(ci): Switch to PR Reviews for triggering CI Allows us to capture the correct SHA to run CI with. Signed-off-by: Jesse Szwedko <[email protected]> * PR feedback Signed-off-by: Jesse Szwedko <[email protected]> * use startsWith rather than contains Signed-off-by: Jesse Szwedko <[email protected]> --------- Signed-off-by: Jesse Szwedko <[email protected]>
- Loading branch information
Showing
12 changed files
with
290 additions
and
366 deletions.
There are no files selected for viewing
279 changes: 134 additions & 145 deletions
279
.github/workflows/integration-comment.yml → .github/workflows/ci-integration-review.yml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
|
@@ -10,28 +10,23 @@ jobs: | |
env: | ||
CARGO_INCREMENTAL: 0 | ||
steps: | ||
- name: (PR comment) Get PR branch | ||
if: ${{ github.event_name == 'issue_comment' }} | ||
uses: xt0rted/pull-request-comment-branch@v2 | ||
id: comment-branch | ||
|
||
- name: (PR comment) Set latest commit status as pending | ||
if: ${{ github.event_name == 'issue_comment' }} | ||
- name: (PR review) Set latest commit status as pending | ||
if: ${{ github.event_name == 'pull_request_review' }} | ||
uses: myrotvorets/[email protected] | ||
with: | ||
sha: ${{ steps.comment-branch.outputs.head_sha }} | ||
sha: ${{ github.events.review.commit_id }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
context: CLI - Linux | ||
status: pending | ||
|
||
- name: (PR comment) Checkout PR branch | ||
if: ${{ github.event_name == 'issue_comment' }} | ||
- name: (PR review) Checkout review SHA | ||
if: ${{ github.event_name == 'pull_request_review' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ steps.comment-branch.outputs.head_ref }} | ||
ref: ${{ github.events.review.commit_id }} | ||
|
||
- name: Checkout branch | ||
if: ${{ github.event_name != 'issue_comment' }} | ||
if: ${{ github.event_name != 'pull_request_review' }} | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cache Cargo registry + index | ||
|
@@ -54,11 +49,11 @@ jobs: | |
run: scripts/upload-test-results.sh | ||
if: always() | ||
|
||
- name: (PR comment) Set latest commit status as ${{ job.status }} | ||
- name: (PR review) Set latest commit status as ${{ job.status }} | ||
uses: myrotvorets/[email protected] | ||
if: always() && github.event_name == 'issue_comment' | ||
if: always() && github.event_name == 'pull_request_review' | ||
with: | ||
sha: ${{ steps.comment-branch.outputs.head_sha }} | ||
sha: ${{ github.events.review.commit_id }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
context: CLI - Linux | ||
status: ${{ job.status }} |
This file contains 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# | ||
# Runs on: | ||
# - scheduled UTC midnight Tues-Sat | ||
# - on PR comment (see comment-trigger.yml) | ||
# - on PR review (see comment-trigger.yml) | ||
# - on demand from github actions UI | ||
|
||
name: Component Features - Linux | ||
|
@@ -20,42 +20,37 @@ jobs: | |
check-component-features: | ||
# use free tier on schedule and 8 core to expedite results on demand invocation | ||
runs-on: ${{ github.event_name == 'schedule' && 'ubuntu-latest' || 'ubuntu-20.04-8core' }} | ||
if: github.event_name == 'issue_comment' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' | ||
if: github.event_name == 'pull_request_review' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' | ||
steps: | ||
- name: (PR comment) Get PR branch | ||
if: github.event_name == 'issue_comment' | ||
uses: xt0rted/pull-request-comment-branch@v2 | ||
id: comment-branch | ||
|
||
- name: (PR comment) Set latest commit status as pending | ||
if: github.event_name == 'issue_comment' | ||
- name: (PR review) Set latest commit status as pending | ||
if: github.event_name == 'pull_request_review' | ||
uses: myrotvorets/[email protected] | ||
with: | ||
sha: ${{ steps.comment-branch.outputs.head_sha }} | ||
sha: ${{ github.events.review.commit_id }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
context: Component Features - Linux | ||
status: pending | ||
|
||
- name: (PR comment) Checkout PR branch | ||
if: github.event_name == 'issue_comment' | ||
- name: (PR review) Checkout PR branch | ||
if: github.event_name == 'pull_request_review' | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ steps.comment-branch.outputs.head_ref }} | ||
ref: ${{ github.events.review.commit_id }} | ||
|
||
- name: Checkout branch | ||
if: github.event_name != 'issue_comment' | ||
if: github.event_name != 'pull_request_review' | ||
uses: actions/checkout@v3 | ||
|
||
- run: sudo -E bash scripts/environment/bootstrap-ubuntu-20.04.sh | ||
- run: bash scripts/environment/prepare.sh | ||
- run: echo "::add-matcher::.github/matchers/rust.json" | ||
- run: make check-component-features | ||
|
||
- name: (PR comment) Set latest commit status as ${{ job.status }} | ||
if: always() && github.event_name == 'issue_comment' | ||
- name: (PR review) Set latest commit status as ${{ job.status }} | ||
if: always() && github.event_name == 'pull_request_review' | ||
uses: myrotvorets/[email protected] | ||
with: | ||
sha: ${{ steps.comment-branch.outputs.head_sha }} | ||
sha: ${{ github.events.review.commit_id }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
context: Component Features - Linux | ||
status: ${{ job.status }} |
This file contains 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 |
---|---|---|
|
@@ -22,29 +22,23 @@ jobs: | |
- arm-unknown-linux-gnueabi | ||
- arm-unknown-linux-musleabi | ||
steps: | ||
|
||
- name: (PR comment) Get PR branch | ||
if: ${{ github.event_name == 'issue_comment' }} | ||
uses: xt0rted/pull-request-comment-branch@v2 | ||
id: comment-branch | ||
|
||
- name: (PR comment) Set latest commit status as pending | ||
if: ${{ github.event_name == 'issue_comment' }} | ||
- name: (PR review) Set latest commit status as pending | ||
if: ${{ github.event_name == 'pull_request_review' }} | ||
uses: myrotvorets/[email protected] | ||
with: | ||
sha: ${{ steps.comment-branch.outputs.head_sha }} | ||
sha: ${{ github.events.review.commit_id }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
context: Cross | ||
status: pending | ||
|
||
- name: (PR comment) Checkout PR branch | ||
if: ${{ github.event_name == 'issue_comment' }} | ||
- name: (PR review) Checkout PR branch | ||
if: ${{ github.event_name == 'pull_request_review' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ steps.comment-branch.outputs.head_ref }} | ||
ref: ${{ github.events.review.commit_id }} | ||
|
||
- name: Checkout branch | ||
if: ${{ github.event_name != 'issue_comment' }} | ||
if: ${{ github.event_name != 'pull_request_review' }} | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v4 | ||
|
@@ -70,30 +64,26 @@ jobs: | |
name: "vector-debug-${{ matrix.target }}" | ||
path: "./target/${{ matrix.target }}/debug/vector" | ||
|
||
- name: (PR comment) Set latest commit status as failed | ||
- name: (PR review) Set latest commit status as failed | ||
uses: myrotvorets/[email protected] | ||
if: failure() && github.event_name == 'issue_comment' | ||
if: failure() && github.event_name == 'pull_request_review' | ||
with: | ||
sha: ${{ steps.comment-branch.outputs.head_sha }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
context: Cross | ||
status: 'failure' | ||
|
||
update-pr-status: | ||
name: (PR comment) Signal result to PR | ||
name: (PR review) Signal result to PR | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 5 | ||
needs: cross-linux | ||
if: needs.cross-linux.result == 'success' && github.event_name == 'issue_comment' | ||
if: needs.cross-linux.result == 'success' && github.event_name == 'pull_request_review' | ||
steps: | ||
- name: (PR comment) Get PR branch | ||
uses: xt0rted/pull-request-comment-branch@v2 | ||
id: comment-branch | ||
|
||
- name: (PR comment) Submit PR result as success | ||
- name: (PR review) Submit PR result as success | ||
uses: myrotvorets/[email protected] | ||
with: | ||
sha: ${{ steps.comment-branch.outputs.head_sha }} | ||
sha: ${{ github.events.review.commit_id }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
context: Cross | ||
status: 'success' |
Oops, something went wrong.