-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postponed: Add MSVC setup to CI #210
base: main
Are you sure you want to change the base?
Changes from 6 commits
0132dfe
d04a187
b4bff1e
8169958
f592b76
c390a9f
aa095de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,47 @@ jobs: | |
name: Build | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Switch to msys2 | ||
shell: powershell | ||
run: echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Setup MSVC | ||
run: | | ||
$script=@' | ||
Push-Location "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build" | ||
& "C:\Windows\System32\cmd.exe" /c "vcvars64.bat & set" | | ||
ForEach-Object { | ||
if ($_ -match "=") { | ||
$v = $_.split("=", 2) | ||
|
||
if ($($v[0]) -match "Path") { | ||
echo "$($v[0])=$($v[1]);C:\msys64\usr\bin" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | ||
} else { | ||
echo "$($v[0])=$($v[1])" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | ||
} | ||
} | ||
} | ||
Pop-Location | ||
'@ | ||
Out-File -FilePath .\msvc.ps1 -InputObject $script -Encoding utf8 | ||
& .\msvc.ps1 | ||
- name: Test MSVC | ||
run: | | ||
$test_program=@' | ||
#include<stdio.h> | ||
|
||
int main() { | ||
printf("Hello World\n"); | ||
return 0; | ||
} | ||
'@ | ||
Out-File -FilePath .\test_program.c -InputObject $test_program -Encoding utf8 | ||
cl .\test_program.c | ||
- name: Install mysys2 dependencies | ||
shell: powershell | ||
run: pacman -S --noconfirm unzip | ||
- name: Show PATH | ||
- name: Show Powershell PATH | ||
shell: powershell | ||
run: Write-Host $env:path | ||
- name: Show bash PATH | ||
shell: powershell | ||
run: bash -c 'echo $PATH' | ||
Comment on lines
+49
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: Currently the git bash is executed here. The Git bash also has a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idea: Use powershell to write to .bashrc and overwrite at least |
||
- uses: actions/checkout@v3 | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup this case. We are adding msys64 at the very last in the
Path
such that binaries likelink.exe
have a higher priority