Skip to content

Commit

Permalink
Restore CI workflow files
Browse files Browse the repository at this point in the history
Rebasing can destory these, so recreate them if necessary.

Signed-off-by: Matthew Sakai <[email protected]>
  • Loading branch information
lorelei-sakai committed Oct 4, 2024
1 parent 0d3ad72 commit 5aba5bd
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on:
pull_request_target:
types: [ opened, reopened, ready_for_review, synchronize ]
workflow_dispatch:

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
Verifying:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Start verification
run: echo Verification Start

# Run assignment action
- name: Assign reviewers and assignees
uses: dm-vdo/vdo-auto-assign@main
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Remove all known labels
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
labels: untested, private testing running, private testing done, private testing failed
type: remove

- name: Add untested label
uses: buildsville/[email protected]
with:
token: ${{secrets.VDODEVEL}}
label: untested
type: add

Testing:
if: github.event.pull_request.draft == false
runs-on: [self-hosted, trusted]
needs: [Verifying]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: dm-linux

- uses: actions/checkout@v2
with:
repository: ${{ github.event.repository.owner.login }}/vdo-devel
path: vdo-devel

- name: Add private testing running label
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing running
type: add

- name: Start private testing
run: |
cd ${{ github.workspace }}/vdo-devel/src/
make DMLINUX_SOURCE_DIR=${{ github.workspace }}/dm-linux dmlinux-jenkins
- name: Copy log file to /permatbit/user/bunsen/artifacts
if: failure()
run: |
REPO=${{ github.repository }}
REPO=${REPO//\//-}
cp -a ${{ github.workspace }}/vdo-devel/logs /permabit/user/bunsen/artifacts/logs.`date +'%Y%m%d%H%M'`.$REPO.${{ github.event.number }}
- name: Remove private testing running label
if: always()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing running
type: remove

- name: Add private testing failed
if: failure()
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: private testing failed
type: add

- name: Add private testing success
if: success()
uses: buildsville/[email protected]
with:
token: ${{secrets.VDODEVEL}}
label: private testing done
type: add
98 changes: 98 additions & 0 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Notify

on:
schedule:
- cron: '0 0,2,10,12,14,16,18,20,22 * * 1-5'
workflow_dispatch:

jobs:
notify_schedule:
env:
ORG: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
runs-on: ubuntu-latest
steps:
- name: Notify PRs Needing Review
uses: octokit/[email protected]
id: prs_need_review
with:
query: |
query needreview($queryString:String!) {
search(type: ISSUE, query: $queryString, last: 100) {
issueCount
}
}
variables: |
queryString: "repo:${{ env.ORG }}/${{env.REPO}}, state:open, is:pr, -label:\"on hold\", review:required,"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: slackapi/[email protected]
if: ${{ env.COUNT > 0 }}
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"PR_MSG": "Number of PRs awaiting reviews in ${{env.REPO}} : ${{ env.COUNT }}",
"PR_LINK": "https://github.com/${{env.ORG}}/${{env.REPO}}/pulls?q=is%3Apr+is%3Aopen+-label%3A%22on%20hold%22+review%3Arequired"
}
env:
COUNT: ${{ fromJSON(steps.prs_need_review.outputs.data).search.issueCount }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACKMSG }}

- name: Notify PRs With Feedback
uses: octokit/[email protected]
id: prs_with_feedback
with:
query: |
query withfeedback($queryString:String!) {
search(type: ISSUE, query: $queryString, last: 100) {
issueCount
}
}
variables: |
queryString: "repo:${{env.ORG}}/${{env.REPO}}, state:open, is:pr, -label:\"on hold\", review:changes_requested,"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: slackapi/[email protected]
if: ${{ env.COUNT > 0 }}
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"PR_MSG": "Number of PRs awaiting replies to reviews ${{env.REPO}} : ${{ env.COUNT }}",
"PR_LINK": "https://github.com/${{env.ORG}}/${{env.REPO}}/pulls?q=is%3Apr+is%3Aopen+-label%3A%22on%20hold%22+review%3Achanges_requested"
}
env:
COUNT: ${{ fromJSON(steps.prs_with_feedback.outputs.data).search.issueCount }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACKMSG }}


- name: Notify PRs With Approval
uses: octokit/[email protected]
id: prs_with_approval
with:
query: |
query withapproval($queryString:String!) {
search(type: ISSUE, query: $queryString, last: 100) {
issueCount
}
}
variables: |
queryString: "repo:${{env.ORG}}/${{env.REPO}}, state:open, is:pr, -label:\"on hold\", review:approved,"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: slackapi/[email protected]
if: ${{ env.COUNT > 0 }}
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"PR_MSG": "Number of PRs approved in ${{env.REPO}} : ${{ env.COUNT }}",
"PR_LINK": "https://github.com/${{env.ORG}}/${{env.REPO}}/pulls?q=is%3Apr+is%3Aopen+-label%3A%22on%20hold%22+review%3Aapproved"
}
env:
COUNT: ${{ fromJSON(steps.prs_with_approval.outputs.data).search.issueCount }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACKMSG }}

0 comments on commit 5aba5bd

Please sign in to comment.