-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from luau-project/fix-cmake-eol-on-tests
fix: EOL problems running CMake tests on Windows
- Loading branch information
Showing
6 changed files
with
193 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: MSYS2 - Install cminpack on Windows through CMake | ||
run-name: MSYS2 - Build, test and install cminpack on Windows through CMake | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
cminpack-MSYS2: | ||
name: cminpack (MSYS2 toolchains + CMake) | ||
runs-on: windows-latest | ||
|
||
defaults: | ||
run: | ||
shell: cmd | ||
|
||
strategy: | ||
matrix: | ||
CMINPACK_BUILD_SHARED_LIBS: [ 'ON' , 'OFF' ] | ||
CMINPACK_BUILD_TYPE: [ 'Release', 'Debug', 'RelWithDebInfo', 'MinSizeRel' ] | ||
CMINPACK_PRECISION: [ 'd' ] # seems to be the only precision that the current tests reference work | ||
MSYS2_CONFIG: | ||
- { sys: mingw64, env: x86_64 } | ||
- { sys: ucrt64, env: ucrt-x86_64 } | ||
- { sys: clang64, env: clang-x86_64 } | ||
|
||
env: | ||
CMINPACK_BUILD_DIR: >- | ||
%RUNNER_TEMP%\cminpack-build-shared-libs-${{ matrix.CMINPACK_BUILD_SHARED_LIBS }}-build-type-${{ matrix.CMINPACK_BUILD_TYPE }}-precision-${{ matrix.CMINPACK_PRECISION }} | ||
CMINPACK_INSTALL_DIR: >- | ||
%RUNNER_TEMP%\cminpack-install-shared-libs-${{ matrix.CMINPACK_BUILD_SHARED_LIBS }}-build-type-${{ matrix.CMINPACK_BUILD_TYPE }}-precision-${{ matrix.CMINPACK_PRECISION }} | ||
MSYS2_PACKAGES_TO_INSTALL: "mingw-w64-${{ matrix.MSYS2_CONFIG.env }}-cc mingw-w64-${{ matrix.MSYS2_CONFIG.env }}-make" | ||
|
||
steps: | ||
- name: Checkout repository to cminpack directory | ||
uses: actions/checkout@v4 | ||
with: | ||
path: cminpack | ||
|
||
# Installing tools from MSYS2 could fail | ||
# on a high number of concurrent jobs. | ||
# So, we keep retrying it for a few times | ||
- name: Install C compiler + GNU Make from MSYS2 | ||
shell: pwsh | ||
run: | | ||
$install_succeeded = $false; | ||
$max_tries = 10; | ||
$tries = 0; | ||
while ((-not $install_succeeded) -and ($tries -lt $max_tries)) | ||
{ | ||
try | ||
{ | ||
& C:\msys64\usr\bin\bash.exe -lc "pacman -S ${{ env.MSYS2_PACKAGES_TO_INSTALL }} --noconfirm" | ||
$install_succeeded = $true; | ||
} | ||
catch | ||
{ | ||
$tries++; | ||
} | ||
} | ||
if (-not $install_succeeded) | ||
{ | ||
Write-Host "Failed to install MSYS2 packages: ${{ env.MSYS2_PACKAGES_TO_INSTALL }}"; | ||
exit 1; | ||
} | ||
- name: Place MSYS2 tools in front of system environment PATH variable | ||
run: echo C:\msys64\${{ matrix.MSYS2_CONFIG.sys }}\bin;%PATH% >> %GITHUB_PATH% | ||
|
||
- name: Configure cminpack build | ||
run: cmake -G "MinGW Makefiles" -DBUILD_SHARED_LIBS=${{ matrix.CMINPACK_BUILD_SHARED_LIBS }} -DCMAKE_BUILD_TYPE=${{ matrix.CMINPACK_BUILD_TYPE }} -DCMINPACK_PRECISION=${{ matrix.CMINPACK_PRECISION }} -DUSE_BLAS=OFF --install-prefix ${{ env.CMINPACK_INSTALL_DIR }} -S cminpack -B ${{ env.CMINPACK_BUILD_DIR }} | ||
|
||
- name: Build cminpack | ||
run: cmake --build ${{ env.CMINPACK_BUILD_DIR }} --config ${{ matrix.CMINPACK_BUILD_TYPE }} | ||
|
||
- name: Test cminpack | ||
run: ctest --test-dir ${{ env.CMINPACK_BUILD_DIR }} --build-config ${{ matrix.CMINPACK_BUILD_TYPE }} | ||
|
||
- name: Install cminpack | ||
run: cmake --install ${{ env.CMINPACK_BUILD_DIR }} --config ${{ matrix.CMINPACK_BUILD_TYPE }} | ||
|
||
- name: Delete checkout directory | ||
run: rmdir /S /Q cminpack | ||
|
||
- name: Delete build directory | ||
run: rmdir /S /Q ${{ env.CMINPACK_BUILD_DIR }} | ||
|
||
- name: Delete install directory | ||
run: rmdir /S /Q ${{ env.CMINPACK_INSTALL_DIR }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 13 additions & 2 deletions
15
.github/workflows/windows-visual-studio-cminpack-install.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,52 @@ | ||
name: MSVC - Install cminpack on Windows through CMake | ||
run-name: MSVC - Build, test and install cminpack on Windows through CMake | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
cminpack-visual-studio: | ||
name: cminpack (MSVC toolchain + CMake) | ||
runs-on: windows-latest | ||
|
||
defaults: | ||
run: | ||
shell: cmd | ||
|
||
strategy: | ||
matrix: | ||
ARCH: [ 'x64', 'Win32'] | ||
CMINPACK_BUILD_SHARED_LIBS: [ 'ON' , 'OFF' ] | ||
CMINPACK_BUILD_TYPE: [ 'Release', 'Debug', 'RelWithDebInfo', 'MinSizeRel' ] | ||
CMINPACK_PRECISION: [ 'd' ] # seems to be the only precision that the current tests reference work | ||
|
||
env: | ||
CMINPACK_BUILD_DIR: >- | ||
%RUNNER_TEMP%\cminpack-build-arch-${{ matrix.ARCH }}-shared-libs-${{ matrix.CMINPACK_BUILD_SHARED_LIBS }}-build-type-${{ matrix.CMINPACK_BUILD_TYPE }}-precision-${{ matrix.CMINPACK_PRECISION }} | ||
CMINPACK_INSTALL_DIR: >- | ||
%RUNNER_TEMP%\cminpack-install-arch-${{ matrix.ARCH }}-shared-libs-${{ matrix.CMINPACK_BUILD_SHARED_LIBS }}-build-type-${{ matrix.CMINPACK_BUILD_TYPE }}-precision-${{ matrix.CMINPACK_PRECISION }} | ||
steps: | ||
- name: Checkout sources with CRLF EOLs for reference test files | ||
run: git config --global core.autocrlf true | ||
- name: Checkout repository to cminpack directory | ||
uses: actions/checkout@v4 | ||
with: | ||
path: cminpack | ||
|
||
- name: Configure cminpack build | ||
run: cmake -DBUILD_SHARED_LIBS=${{ matrix.CMINPACK_BUILD_SHARED_LIBS }} -DCMAKE_BUILD_TYPE=${{ matrix.CMINPACK_BUILD_TYPE }} -DCMINPACK_PRECISION=${{ matrix.CMINPACK_PRECISION }} -DUSE_BLAS=OFF -A ${{ matrix.ARCH }} --install-prefix ${{ env.CMINPACK_INSTALL_DIR }} -S cminpack -B ${{ env.CMINPACK_BUILD_DIR }} | ||
|
||
- name: Build cminpack | ||
run: cmake --build ${{ env.CMINPACK_BUILD_DIR }} --config ${{ matrix.CMINPACK_BUILD_TYPE }} | ||
|
||
- name: Test cminpack | ||
run: ctest --test-dir ${{ env.CMINPACK_BUILD_DIR }} --build-config ${{ matrix.CMINPACK_BUILD_TYPE }} | ||
|
||
- name: Install cminpack | ||
run: cmake --install ${{ env.CMINPACK_BUILD_DIR }} --config ${{ matrix.CMINPACK_BUILD_TYPE }} | ||
|
||
- name: Delete checkout directory | ||
run: rmdir /S /Q cminpack | ||
|
||
- name: Delete build directory | ||
run: rmdir /S /Q ${{ env.CMINPACK_BUILD_DIR }} | ||
|
||
- name: Delete install directory | ||
run: rmdir /S /Q ${{ env.CMINPACK_INSTALL_DIR }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.