Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Create an action runner build for MSVC. #405

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
656b314
Create main.yml
wmaxey Mar 23, 2023
a7993ef
Fetch ninja and the CTK on windows.
wmaxey Mar 23, 2023
df881bc
Run in powershell.
wmaxey Mar 23, 2023
582f497
Not sure what I'm doing.
wmaxey Mar 23, 2023
8e975b1
Still don't know what I'm doing.
wmaxey Mar 23, 2023
81fe689
Fix syntax error?
wmaxey Mar 23, 2023
42426e5
install->fetch typo
wmaxey Mar 23, 2023
cb79ced
Fix script paths.
wmaxey Mar 23, 2023
ec9f47f
Spaces, not commas for architecture parameter.
wmaxey Mar 23, 2023
40d88d1
Try to convince CMake to find the CTK from nvcc on the path.
wmaxey Mar 23, 2023
033c426
Use cl.exe for CMAKE_CXX_COMPILER
wmaxey Mar 23, 2023
f97a54a
Add a script for hacking out vcvars.
wmaxey Mar 23, 2023
b3c6ce1
Change path for msvc.
wmaxey Mar 23, 2023
05da047
Try different method to get vs install path.
wmaxey Mar 23, 2023
890df41
move stuff to same script to possibly keep env vars live.
wmaxey Mar 23, 2023
0f9111d
Set GITHUB_ENV between steps.
wmaxey Mar 24, 2023
2ab5e40
I'm an idiot.
wmaxey Mar 24, 2023
04c0b56
Also send CL environment variables up the chain.
wmaxey Mar 24, 2023
0dd8ed3
Wait for process to finish.
wmaxey Mar 24, 2023
5077e49
Split fetch lit into its own command.
wmaxey Mar 24, 2023
03369ca
Connecting lit to the build directory.
wmaxey Mar 24, 2023
5d020b9
fixup path stuff in python.
wmaxey Mar 24, 2023
079f7a1
Try to fix error accessing var.
wmaxey Mar 24, 2023
259d8e6
Try using py instead.
wmaxey Mar 24, 2023
83acea1
Python stuff needs to be hacked around.
wmaxey Mar 24, 2023
a6f265f
Split tests from config step.
wmaxey Mar 24, 2023
5cd3ca5
Upload a result text for the PR submitter to peruse.
wmaxey Mar 24, 2023
521b60c
Fixup typo.
wmaxey Mar 24, 2023
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
20 changes: 20 additions & 0 deletions .github/action-scripts/configure-vcvars.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$msvcPath = "$(vswhere -products * -latest -property installationPath)"

Write-Output "Loading VC from: $msvcPath\VC\Auxiliary\Build"

Push-Location "$msvcPath\VC\Auxiliary\Build"
cmd /c "vcvars64.bat & set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
echo "$($v[0])=$($v[1])" >> $ENV:GITHUB_ENV
}
}
Pop-Location

# Stupid, but makes cl.exe happy
$global:CC_FP = $(get-command cl).Source.Replace("\","/")

Write-Host "`nVisual Studio Command Prompt variables set." -ForegroundColor Yellow
Write-Host "Use `$CC_FP as shortcut for Cmake: $CC_FP" -ForegroundColor Yellow

9 changes: 9 additions & 0 deletions .github/action-scripts/fetch-cuda.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Invoke-WebRequest -Uri "https://developer.download.nvidia.com/compute/cuda/12.1.0/network_installers/cuda_12.1.0_windows_network.exe" -OutFile "./cuda_network.exe"
Start-Process -Wait -FilePath ./cuda_network.exe -ArgumentList "-s nvcc_12.1 cudart_12.1"

$ENV:PATH="$ENV:PATH;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin"
$ENV:CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1"

echo "PATH=$ENV:PATH" >> $ENV:GITHUB_ENV
echo "CUDA_PATH=$ENV:CUDA_PATH" >> $ENV:GITHUB_ENV
7 changes: 7 additions & 0 deletions .github/action-scripts/fetch-lit.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$LIT_PATH = "$((gi $((gcm python).path)).Directory.FullName)\Scripts"

python -m pip install wheel
python -m pip install lit

$ENV:PATH="$ENV:PATH;$LIT_PATH"
echo "PATH=$ENV:PATH" >> $ENV:GITHUB_ENV
6 changes: 6 additions & 0 deletions .github/action-scripts/fetch-ninja.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Fetch Ninja, this is a powershell step because of Expand-Archive
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip" -OutFile "./ninja.zip"
Expand-Archive ./ninja.zip

$ENV:PATH="$ENV:PATH;$(pwd)\ninja"
echo "PATH=$ENV:PATH" >> $ENV:GITHUB_ENV
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
pull_request:
branches:
- main

permissions:
contents: read
pull-requests: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
Lit-NoExecutor:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master

- name: Install Lit
run: .github\action-scripts\fetch-lit.ps1

- name: Fetch CUDA Toolkit
run: .github\action-scripts\fetch-cuda.ps1

- name: Fetch Ninja
run: .github\action-scripts\fetch-ninja.ps1

- name: Set vcvars
run: .github\action-scripts\configure-vcvars.ps1

- name: Configure CMake project
run: |
echo "CUDA_PATH: $ENV:CUDA_PATH"
cmake -S ./ -B ../build -DLIBCUDACXX_ENABLE_LIBCUDACXX_TESTS=ON -DCMAKE_CXX_COMPILER=cl -DCMAKE_CUDA_COMPILER=nvcc -G Ninja

- name: Build libcudacxx tests
run: |
$ENV:LIBCUDACXX_SITE_CONFIG="$(pwd)/../build/test/lit.site.cfg"
lit --no-progress-bar -o ./lit_test_results.json -Dcompute_archs=90 -Dexecutor="NoopExecutor()" -Dstd=c++20 -j3 .upstream-tests/test

- uses: actions/upload-artifact@v3
with:
name: lit_test_results.json
path: ./lit_test_results.json