Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 40 additions & 0 deletions .github/actions/add_job_link/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Add job link to PR description'
inputs:
pull_request_number:
description: 'Pull Request number'
required: true
link_name:
description: 'Name of link, should contain only alphanumeric characters, dashes, and underscores'
required: true
runs:
using: "composite"
steps:
- name: Update PR description with preview link
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const prNumber = parseInt(${{ inputs.pull_request_number }});
const newLink = `https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}`;
const newLine = `[${{ inputs.link_name }}](${newLink})`;

const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});

let body = pr.body || '';
const regex = /\[${{ inputs.link_name }}\]\([^)]+\)/;

if (regex.test(body)) {
body = body.replace(regex, newLine);
} else {
body = body.trim() + `\n\n${newLine}`;
}

await github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
body
});
20 changes: 20 additions & 0 deletions .github/workflows/conformance_weight_compression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,23 @@ jobs:
run: |
pip install defusedxml==0.7.1
python .github/scripts/pytest_md_summary.py pytest-results.xml >> $GITHUB_STEP_SUMMARY

update-pr-description:
name: Update PR description
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }}
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
sparse-checkout: .github/actions/add_job_link
- name: Update PR preview link
uses: ./.github/actions/add_job_link
with:
pull_request_number: ${{ inputs.pull_request_number }}
link_name: "Test_Weight_Compression"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,23 @@ jobs:
run: |
pip install defusedxml==0.7.1
python .github/scripts/pytest_md_summary.py pytest-results.xml >> $GITHUB_STEP_SUMMARY

update-pr-description:
name: Update PR description
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }}
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
sparse-checkout: .github/actions/add_job_link
- name: Update PR preview link
uses: ./.github/actions/add_job_link
with:
pull_request_number: ${{ inputs.pull_request_number }}
link_name: "Test_Examples"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,23 @@ jobs:
export PATH=/usr/local/cuda-12.4/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
pytest tests/cross_fw/install -rA -s --host-configuration gpu --backend torch

update-pr-description:
name: Update PR description
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }}
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
sparse-checkout: .github/actions/add_job_link
- name: Update PR preview link
uses: ./.github/actions/add_job_link
with:
pull_request_number: ${{ inputs.pull_request_number }}
link_name: "Test_Install"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,23 @@ jobs:
run: pytest -ra tests/openvino
env:
ONEDNN_MAX_CPU_ISA: AVX2

update-pr-description:
name: Update PR description
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pull_request_number != '' }}
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
sparse-checkout: .github/actions/add_job_link
- name: Update PR preview link
uses: ./.github/actions/add_job_link
with:
pull_request_number: ${{ inputs.pull_request_number }}
link_name: "Test_MacOS"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}