Skip to content

[Automatic] Update versions, run ID: 24618802485 #22

[Automatic] Update versions, run ID: 24618802485

[Automatic] Update versions, run ID: 24618802485 #22

name: Generate test matrices pages
on:
pull_request_target:
branches:
- main
types: [closed]
workflow_dispatch:
inputs:
branch:
description: 'Branch to check out'
default: 'main'
required: false
type: string
pr_number:
description: 'PR number to process (must be specified as a number or "all")'
required: true
type: string
gh_pages_branch:
description: 'GitHub pages branch to update'
default: 'gh-pages'
required: false
type: string
permissions:
contents: write
issues: write
jobs:
generate-matrix:
if: github.event_name != 'pull_request_target' || github.repository == 'rh-ecosystem-edge/amd-ci'
runs-on: ubuntu-latest
env:
DASHBOARD_OUTPUT_DIR: 'workflows/gpu_operator_dashboard/output'
steps:
- name: Set dynamic env vars
run: |
echo "DASHBOARD_DATA_FILEPATH=${DASHBOARD_OUTPUT_DIR}/gpu_operator_matrix.json" >> "$GITHUB_ENV"
echo "DASHBOARD_HTML_FILEPATH=${DASHBOARD_OUTPUT_DIR}/gpu_operator_matrix.html" >> "$GITHUB_ENV"
echo "GH_PAGES_BRANCH=${{ github.event.inputs.gh_pages_branch || 'gh-pages' }}" >> "$GITHUB_ENV"
env:
DASHBOARD_OUTPUT_DIR: ${{ env.DASHBOARD_OUTPUT_DIR }}
- name: Determine PR Number
id: determine_pr
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request_target" ]; then
echo "Processing merged pull request."
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
else
echo "PR_NUMBER=${{ github.event.inputs.pr_number }}" >> "$GITHUB_OUTPUT"
fi
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref || github.event.inputs.branch }}
- name: Checkout GitHub Pages
uses: actions/checkout@v4
with:
ref: ${{ env.GH_PAGES_BRANCH }}
path: ${{ env.DASHBOARD_OUTPUT_DIR }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install Dependencies
run: |
pip install -r workflows/gpu_operator_dashboard/requirements.txt
- name: Fetch CI Data
run: |
echo "Processing PR: ${{ steps.determine_pr.outputs.PR_NUMBER }}"
python -m workflows.gpu_operator_dashboard.fetch_ci_data \
--pr_number "${{ steps.determine_pr.outputs.PR_NUMBER }}" \
--baseline_data_filepath "${{ env.DASHBOARD_DATA_FILEPATH }}" \
--merged_data_filepath "${{ env.DASHBOARD_DATA_FILEPATH }}"
- name: Generate HTML Dashboard (only if JSON changed)
run: |
cd "${{ env.DASHBOARD_OUTPUT_DIR }}"
if [[ ${{ github.event_name }} == "pull_request_target" ]] && git diff --exit-code gpu_operator_matrix.json; then
echo "no changes"
else
cd "${{ github.workspace }}"
python -m workflows.gpu_operator_dashboard.generate_ci_dashboard \
--dashboard_data_filepath "${{ env.DASHBOARD_DATA_FILEPATH }}" \
--dashboard_html_filepath "${{ env.DASHBOARD_HTML_FILEPATH }}"
fi
- name: Deploy HTML to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: ${{ env.GH_PAGES_BRANCH }}
folder: ${{ env.DASHBOARD_OUTPUT_DIR }}
clean: false
force: false
- name: Delete merged branch
if: |
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged == true &&
github.event.pull_request.user.login == 'github-actions[bot]'
env:
BRANCH: ${{ github.event.pull_request.head.ref }}
run: |
echo "Deleting merged branch: $BRANCH"
git push origin --delete "$BRANCH" || echo "Branch $BRANCH already deleted or doesn't exist"