Skip to content

Commit

Permalink
Fix Several Problems with Auto-Issue Creation (#36)
Browse files Browse the repository at this point in the history
- Add some logic to reuse existing rolling build failure bug if one exists.
- Fix misuse of invoking workflow causing rolling build failure
- Several other QoL improvements, cleanup
- Users are still not getting notifications
  • Loading branch information
manbearian authored Nov 3, 2023
1 parent 21818ef commit c949445
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 13 deletions.
37 changes: 24 additions & 13 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,33 @@ on:

jobs:
call-workflow:
uses: ./.github/workflows/test-plugin.yml
with:
triton-ref: 'main'
triton-shared-ref: 'main'
force-failure: ${{ inputs.force-failure }}
report-failure:
runs-on: ubuntu-latest
needs: [call-workflow]
if: ${{ always() && inputs.notify-on-failure && needs.call-workflow.result == 'failure' }}
steps:
- name: Force Failure
if: ${{ github.event.inputs.force-failure }}
run: exit 1
- name: Run Triton-Shared Testing
uses: ./.github/workflows/test-plugin.yml
with:
triton-ref: 'main'
triton-shared-ref: 'main'
- name: Report Failure
if: ${{ failure() }}
run: |
gh --repo ${{ github.repository }} issue create \
--title "Rolling Build Failure $(date +'%Y-%m-%d')" \
--body "cc @microsoft/aifx-compilers
The rolling build has failed. See: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
issues=$(gh --repo microsoft/triton-shared issue list --label nightly-build-failure --state open)
build_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
notificiation_list="@microsoft/aifx-compilers"
repo=microsoft/triton-shared #"${{ github.repository }}"
if [ -z "$issues" ]; then
gh --repo $repo issue create \
--title "Nightly Build Failure $(date +'%Y-%m-%d')" \
--label "nightly-build-failure" \
--body "cc $notificiation_list
The nightly build has failed. See: $build_url"
else
issue_number=$(echo "$issues" | head -n 1 | awk '{print $1}')
gh --repo $repo issue comment $issue_number \
--body "cc $notificiation_list
The nightly build has failed again. See: $build_url"
fi
env:
GH_TOKEN: ${{ github.token }}
32 changes: 32 additions & 0 deletions .github/workflows/test-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
triton-shared-ref:
required: true
type: string
force-failure:
default: false
type: boolean
workflow_dispatch:
inputs:
triton-ref:
Expand All @@ -17,12 +20,19 @@ on:
triton-shared-ref:
required: true
type: string
force-failure:
default: false
type: boolean


jobs:
build_and_test_triton_shared:
runs-on: ubuntu-latest

steps:
- name: Force Failure
if: ${{ inputs.force-failure }}
run: exit 1

- name: Checkout Triton
uses: actions/checkout@v4
Expand Down Expand Up @@ -72,3 +82,25 @@ jobs:
echo "Coult not find '${LIT_TEST_DIR}'" ; exit -1
fi
lit -v "${LIT_TEST_DIR}"
- name: Report Failure
if: ${{ inputs.notify-on-failure && failure() }}
run: |
issues=$(gh --repo microsoft/triton-shared issue list --label nightly-build-failure --state open)
build_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
notificiation_list="@microsoft/aifx-compilers"
repo=microsoft/triton-shared #"${{ github.repository }}"
if [ -z "$issues" ]; then
gh --repo $repo issue create \
--title "Nightly Build Failure $(date +'%Y-%m-%d')" \
--label "nightly-build-failure" \
--body "cc $notificiation_list
The nightly build has failed. See: $build_url"
else
issue_number=$(echo "$issues" | head -n 1 | awk '{print $1}')
gh --repo $repo issue comment $issue_number \
--body "cc $notificiation_list
The nightly build has failed again. See: $build_url"
fi
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit c949445

Please sign in to comment.