Skip to content
182 changes: 182 additions & 0 deletions .github/workflows/therock-ci-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: TheRock CI Windows

on:
workflow_call:
inputs:
cmake_options:
type: string
project_to_test:
type: string
subtree_checkout:
type: string

permissions:
contents: read

jobs:
therock-build-windows:
name: Build Windows Packages
runs-on: azure-windows-scale-rocm
Comment thread
geomin12 marked this conversation as resolved.
outputs:
AMDGPU_FAMILIES: ${{ env.AMDGPU_FAMILIES }}
permissions:
contents: read
id-token: write
defaults:
run:
shell: bash
env:
BUILD_DIR: B:\build
CCACHE_DIR: "${{ github.workspace }}/.container-cache/ccache"
CCACHE_MAXSIZE: "700M"
# TODO(geomin12): Add matrix of families
# To get a fast signal of windows building for TheRock, adding gfx110X
AMDGPU_FAMILIES: "gfx110X-dgpu"
Comment thread
geomin12 marked this conversation as resolved.
steps:
- name: Generate a token for rocm-libraries
id: generate-token
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: "Checking out repository for rocm-libraries"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: ${{ github.repository }}
ref: refs/pull/${{ github.event.pull_request.number }}/merge
Comment thread
geomin12 marked this conversation as resolved.
sparse-checkout: |
.github
${{ inputs.subtree_checkout }}
fetch-depth: 0 # Needed for subtree splitting
token: ${{ steps.generate-token.outputs.token }}
Comment on lines +44 to +53
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR broke postsubmit and was reverted: #467. See logs at https://github.com/ROCm/rocm-libraries/actions/runs/15988190629/job/45096452132#step:3:55

Fetching the repository
  "C:\Program Files\Git\cmd\git.exe" -c protocol.version=2 fetch --prune --no-recurse-submodules --filter=blob:none origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* +refs/pull//merge:refs/remotes/pull//merge
  Error: fatal: invalid refspec '+refs/pull//merge:refs/remotes/pull//merge'
  The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128

The checkout code here should instead match what is on Linux:

- name: "Checking out repository for rocm-libraries"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: |
.github
${{ inputs.subtree_checkout }}
token: ${{ steps.generate-token.outputs.token }}

Without the ref: refs/pull/${{ github.event.pull_request.number }}/merge


- name: Checkout TheRock repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: "ROCm/TheRock"
path: "TheRock"
ref: "users/geomin12/issue-664"

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.12'

- name: Install python deps
run: |
pip install -r TheRock/requirements.txt

- name: Install requirements
run: |
choco install --no-progress -y ccache
choco install --no-progress -y ninja
choco install --no-progress -y strawberryperl
echo "$PATH;C:\Strawberry\c\bin" >> $GITHUB_PATH
choco install --no-progress -y awscli
echo "$PATH;C:\Program Files\Amazon\AWSCLIV2" >> $GITHUB_PATH

# After other installs, so MSVC get priority in the PATH.
- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Fetch sources
run: |
git config --global core.longpaths true
python ./TheRock/build_tools/fetch_sources.py --jobs 96 --no-include-math-libs

- name: Checkout closed source AMDGPU/ROCm interop library folder
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: nod-ai/amdgpu-windows-interop
path: amdgpu-windows-interop
lfs: true
Comment thread
geomin12 marked this conversation as resolved.

- name: Configure Projects
env:
amdgpu_families: ${{ env.AMDGPU_FAMILIES }}
package_version: "ADHOCBUILD"
extra_cmake_options: "-DBUILD_TESTING=OFF -DTHEROCK_USE_EXTERNAL_ROCM_LIBRARIES=ON -DTHEROCK_ROCM_LIBRARIES_SOURCE_DIR=${{ github.workspace }} ${{ inputs.cmake_options }}"
run: |
# clear cache before build and after download
ccache -z
python3 TheRock/build_tools/github_actions/build_configure.py

- name: Build therock-dist
run: cmake --build "${{ env.BUILD_DIR }}" --target therock-dist

- name: Build therock-archives
run: cmake --build "${{ env.BUILD_DIR }}" --target therock-archives

- name: Report
if: ${{ !cancelled() }}
run: |
echo "Build dir:"
echo "------------"
ls -lh "${{ env.BUILD_DIR }}"
echo "Artifact Archives:"
echo "------------------"
ls -lh "${{ env.BUILD_DIR }}"/artifacts/*.tar.xz
echo "Artifacts:"
echo "----------"
du -h -d 1 "${{ env.BUILD_DIR }}"/artifacts
echo "CCache Stats:"
echo "-------------"
ccache -s

- name: "Build size report"
if: always()
shell: powershell
run: |
$fs = Get-PSDrive -PSProvider "FileSystem"
$fsout = $fs | Select-Object -Property Name,Used,Free,Root
$fsout | % {$_.Used/=1GB;$_.Free/=1GB;$_} | Write-Host
get-disk | Select-object @{Name="Size(GB)";Expression={$_.Size/1GB}} | Write-Host

- name: Configure AWS Credentials
if: always()
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::692859939525:role/therock-artifacts-external

- name: Create Logs index Files
if: always()
run: |
python3 TheRock/build_tools/github_actions/create_log_index.py \
--build-dir=${{ env.BUILD_DIR }} \
--amdgpu-family=${{ env.AMDGPU_FAMILIES }}

- name: Upload artifacts
run: |
python TheRock/build_tools/github_actions/upload_build_artifacts.py \
--run-id ${{ github.run_id }} \
--amdgpu-family ${{ env.AMDGPU_FAMILIES }} \
--build-dir ${{ env.BUILD_DIR }}

- name: Upload Logs
if: always()
run: |
python3 TheRock/build_tools/github_actions/upload_build_logs_to_s3.py \
--build-dir=${{ env.BUILD_DIR }} \
--run-id ${{ github.run_id }} \
--amdgpu-family ${{ env.AMDGPU_FAMILIES }}

- name: Add Links to Job Summary
if: always()
run: |
python TheRock/build_tools/github_actions/upload_build_summary.py \
--run-id ${{ github.run_id }} \
--amdgpu-family ${{ env.AMDGPU_FAMILIES }} \
--build-dir ${{ env.BUILD_DIR }}

therock-test-windows:
name: "Test"
needs: [therock-build-windows]
uses: ./.github/workflows/therock-test-packages.yml
with:
project_to_test: ${{ inputs.project_to_test }}
amdgpu_families: ${{ needs.therock-build-windows.outputs.AMDGPU_FAMILIES }}
test_runs_on: ""
platform: "windows"
18 changes: 18 additions & 0 deletions .github/workflows/therock-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,21 @@ jobs:
cmake_options: ${{ matrix.projects.cmake_options }}
project_to_test: ${{ matrix.projects.project_to_test }}
subtree_checkout: ${{ matrix.projects.subtree_checkout }}

therock-ci-windows:
name: TheRock CI Windows
permissions:
contents: read
id-token: write
needs: setup
if: ${{ needs.setup.outputs.projects != '[]' }}
strategy:
fail-fast: false
matrix:
projects: ${{ fromJSON(needs.setup.outputs.projects) }}
uses: ./.github/workflows/therock-ci-windows.yml
secrets: inherit
with:
cmake_options: ${{ matrix.projects.cmake_options }}
project_to_test: ${{ matrix.projects.project_to_test }}
subtree_checkout: ${{ matrix.projects.subtree_checkout }}
1 change: 1 addition & 0 deletions .github/workflows/therock-test-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
configure_test_matrix:
name: "Configure test matrix"
runs-on: ubuntu-24.04
if: ${{ inputs.test_runs_on != '' }}
outputs:
components: ${{ steps.configure.outputs.components }}
steps:
Expand Down