# This workflow is used to invoke the OSDB jenkins job for rocm CI. The python script can be used to invoke any jenkins job but input params needs to be configured properly name: ROCm CI OSDB # Controls when the workflow will run on: push: branches: [amd-mainline] workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel, below is a single job called invoke jenkins jobs jobs: # This workflow contains a single job called "build" invoke_jenkins_OSDB: # The type of runner that the job will run on. For github hosted runner use (${{ 'ubuntu-latest' }}) or self-hosted for sel-hosted runner. runs-on: self-hosted container: image: compute-artifactory.amd.com:5000/rocm-base-images/ghemu-action-ubuntu-24.04:2024101101 env: svc_acc_org_secret: ${{secrets.ROCM_SERVICE_ACCOUNT_PAT}} input_sha: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }} input_pr_num: ${{ github.event.pull_request.number != '' && github.event.pull_request.number || 0 }} input_pr_url: ${{ github.event.pull_request.html_url != '' && github.event.pull_request.html_url || '' }} input_pr_title: ${{ github.event.pull_request.title != '' && github.event.pull_request.title || '' }} # set the pipeline name here based on branch name pipeline_name: ${{ github.event.pull_request.base.ref == 'amd-mainline' && 'compute-psdb-no-npi' || 'compute-rocm-dkms-no-npi-hipclang' }} # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Check out rocm_ci_infra private repo uses: actions/checkout@main with: repository: AMD-ROCm-Internal/rocm_ci_infra token: ${{ secrets.ROCM_SERVICE_ACCOUNT_PAT }} # Runs a set of commands using the runners shell - name: Getting Event Details run: | echo $(pwd) echo $GITHUB_ENV echo $GITHUB_REPOSITORY echo $GITHUB_SERVER_URL echo "GITHUB_SHA is: $GITHUB_SHA" echo "GITHUB_WORKFLOW_SHA is: $GITHUB_WORKFLOW_SHA" echo "GITHUB_BASE_REF is: $GITHUB_BASE_REF" echo "GITHUB_REF_NAME is: $GITHUB_REF_NAME" echo "github.event.pull_request.id is: ${{github.event.pull_request.id}}" echo "github.event.pull_request.html_url is: ${{github.event.pull_request.html_url}}" echo "github.event.pull_request.number is: ${{github.event.pull_request.number}}" echo "github.event.pull_request.title is: ${{github.event.pull_request.title}}" echo "github.event.pull_request.url is: ${{github.event.pull_request.url}}" echo "github.event.pull_request.issue_url is: ${{github.event.pull_request.issue_url}}" echo "github.event.pull_request.comments_url is: ${{github.event.pull_request.comments_url}}" echo "github.event.pull_request.statuses_url is: ${{github.event.pull_request.statuses_url}}" echo "github.event.pull_request.head.sha is: ${{github.event.pull_request.head.sha}}" echo "github.event.pull_request.base.ref is: ${{github.event.pull_request.base.ref}}" echo "github.event.pull_request.merge_commit_sha is: ${{github.event.pull_request.merge_commit_sha}}" echo "github.event.pull_request is: ${{github.event.pull_request}}" # pipeline name shuould be unique to the workfow yml for a given repository #curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{secrets.ROCM_SERVICE_ACCOUNT_PAT}}" ${{github.event.pull_request.comments_url}} -d '{"body":"Github action triggered jenkins job for compute-psdb-staging-smi-libs-ghemu "}' #python jenkins_api.py -jn compute-psdb-staging-smi-libs-ghemu -ghr $GITHUB_REPOSITORY -ghsha $input_sha -ghprn $input_pr_num -ghpru "$input_pr_url" -ghprt "$input_pr_title" - name: Trigger Jenkins Pipeline run: | echo "running jenkins_api.py with input sha - $input_sha for pull request - $input_pr_url" python3 jenkins_api.py -jn $pipeline_name -ghr $GITHUB_REPOSITORY -ghsha $input_sha -ghprn $input_pr_num -ghpru "$input_pr_url" -ghprt "$input_pr_title" -ghpat $svc_acc_org_secret