aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2025-03-09 20:25:38 -0300
committerHisham Muhammad <hisham@gobolinux.org>2025-03-09 20:25:38 -0300
commit8ba26746be59901a8ee4a161e2e376942c3fb647 (patch)
tree2bb041b920ffe082f1495d90debef60e0c5739ae
parent094a0fde50e404535e28cae856772f9f346932ec (diff)
downloadluarocks-8ba26746be59901a8ee4a161e2e376942c3fb647.tar.gz
luarocks-8ba26746be59901a8ee4a161e2e376942c3fb647.tar.bz2
luarocks-8ba26746be59901a8ee4a161e2e376942c3fb647.zip
ci: enable on main branch
-rw-r--r--.github/workflows/test.yml72
1 files changed, 36 insertions, 36 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 46472181..f178284b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -2,7 +2,7 @@ name: test
2 2
3on: 3on:
4 push: 4 push:
5 branches: master 5 branches: main
6 pull_request: 6 pull_request:
7 branches: '*' 7 branches: '*'
8 workflow_dispatch: 8 workflow_dispatch:
@@ -235,7 +235,7 @@ jobs:
235 EXCLUDE: "" 235 EXCLUDE: ""
236 TESTTYPE: "" 236 TESTTYPE: ""
237 ARCH: x86 237 ARCH: x86
238 238
239 # 239 #
240 # MinGW-w64 with Universal C Run Time 240 # MinGW-w64 with Universal C Run Time
241 # provided by MSYS2 241 # provided by MSYS2
@@ -308,7 +308,7 @@ jobs:
308 - name: Add bin directory of dependencies to system PATH environment variable 308 - name: Add bin directory of dependencies to system PATH environment variable
309 if: ${{ matrix.COMPILER == 'vs' }} 309 if: ${{ matrix.COMPILER == 'vs' }}
310 run: echo ${{ env.LUAROCKS_DEPS_DIR }}\bin>>${{ github.path }} 310 run: echo ${{ env.LUAROCKS_DEPS_DIR }}\bin>>${{ github.path }}
311 311
312 - name: Restore zlib tarball 312 - name: Restore zlib tarball
313 if: ${{ matrix.COMPILER == 'vs' }} 313 if: ${{ matrix.COMPILER == 'vs' }}
314 id: restore-zlib-tarball 314 id: restore-zlib-tarball
@@ -322,20 +322,20 @@ jobs:
322 run: | 322 run: |
323 curl -o "${{ github.workspace }}\zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz" ^ 323 curl -o "${{ github.workspace }}\zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz" ^
324 "https://zlib.net/zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz" 324 "https://zlib.net/zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz"
325 325
326 - name: Save zlib tarball 326 - name: Save zlib tarball
327 if: ${{ matrix.COMPILER == 'vs' && steps.restore-zlib-tarball.outputs.cache-hit != 'true' }} 327 if: ${{ matrix.COMPILER == 'vs' && steps.restore-zlib-tarball.outputs.cache-hit != 'true' }}
328 uses: actions/cache/save@v4 328 uses: actions/cache/save@v4
329 with: 329 with:
330 path: zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz 330 path: zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz
331 key: zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }} 331 key: zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}
332 332
333 - name: Install dependency (zlib) 333 - name: Install dependency (zlib)
334 if: ${{ matrix.COMPILER == 'vs' }} 334 if: ${{ matrix.COMPILER == 'vs' }}
335 run: | 335 run: |
336 cd "${{ runner.temp }}" && mkdir zlib && cd zlib && ^ 336 cd "${{ runner.temp }}" && mkdir zlib && cd zlib && ^
337 tar -xf "${{ github.workspace }}\zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz" 337 tar -xf "${{ github.workspace }}\zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz"
338 338
339 IF "${{ matrix.COMPILER }}"=="vs" ( 339 IF "${{ matrix.COMPILER }}"=="vs" (
340 SET CMAKE_GENERATOR=NMake Makefiles 340 SET CMAKE_GENERATOR=NMake Makefiles
341 SET CC=cl 341 SET CC=cl
@@ -343,7 +343,7 @@ jobs:
343 SET CMAKE_GENERATOR=MinGW Makefiles 343 SET CMAKE_GENERATOR=MinGW Makefiles
344 SET CC=gcc 344 SET CC=gcc
345 ) 345 )
346 346
347 cmake -G "%CMAKE_GENERATOR%" ^ 347 cmake -G "%CMAKE_GENERATOR%" ^
348 -DCMAKE_C_COMPILER=%CC% ^ 348 -DCMAKE_C_COMPILER=%CC% ^
349 -DCMAKE_BUILD_TYPE=Release ^ 349 -DCMAKE_BUILD_TYPE=Release ^
@@ -359,7 +359,7 @@ jobs:
359 copy "${{ env.LUAROCKS_DEPS_DIR }}\lib\zlib.lib" ^ 359 copy "${{ env.LUAROCKS_DEPS_DIR }}\lib\zlib.lib" ^
360 "${{ env.LUAROCKS_DEPS_DIR }}\lib\z.lib" 360 "${{ env.LUAROCKS_DEPS_DIR }}\lib\z.lib"
361 ) 361 )
362 362
363 - name: Restore bzip2 tarball 363 - name: Restore bzip2 tarball
364 if: ${{ matrix.COMPILER == 'vs' }} 364 if: ${{ matrix.COMPILER == 'vs' }}
365 id: restore-bzip2-tarball 365 id: restore-bzip2-tarball
@@ -374,7 +374,7 @@ jobs:
374 cd "${{ runner.temp }}" && ^ 374 cd "${{ runner.temp }}" && ^
375 git clone https://gitlab.com/bzip2/bzip2 && ^ 375 git clone https://gitlab.com/bzip2/bzip2 && ^
376 tar -czvf "${{ github.workspace }}\bzip2.tar.gz" bzip2 376 tar -czvf "${{ github.workspace }}\bzip2.tar.gz" bzip2
377 377
378 - name: Save bzip2 tarball 378 - name: Save bzip2 tarball
379 if: ${{ matrix.COMPILER == 'vs' && steps.restore-bzip2-tarball.outputs.cache-hit != 'true' }} 379 if: ${{ matrix.COMPILER == 'vs' && steps.restore-bzip2-tarball.outputs.cache-hit != 'true' }}
380 uses: actions/cache/save@v4 380 uses: actions/cache/save@v4
@@ -387,7 +387,7 @@ jobs:
387 run: | 387 run: |
388 cd "${{ runner.temp }}" && ^ 388 cd "${{ runner.temp }}" && ^
389 tar -xf "${{ github.workspace }}\bzip2.tar.gz" 389 tar -xf "${{ github.workspace }}\bzip2.tar.gz"
390 390
391 IF "${{ matrix.COMPILER }}"=="vs" ( 391 IF "${{ matrix.COMPILER }}"=="vs" (
392 SET CMAKE_GENERATOR=NMake Makefiles 392 SET CMAKE_GENERATOR=NMake Makefiles
393 SET CC=cl 393 SET CC=cl
@@ -395,7 +395,7 @@ jobs:
395 SET CMAKE_GENERATOR=MinGW Makefiles 395 SET CMAKE_GENERATOR=MinGW Makefiles
396 SET CC=gcc 396 SET CC=gcc
397 ) 397 )
398 398
399 cmake -G "%CMAKE_GENERATOR%" ^ 399 cmake -G "%CMAKE_GENERATOR%" ^
400 -DCMAKE_C_COMPILER=%CC% ^ 400 -DCMAKE_C_COMPILER=%CC% ^
401 -DCMAKE_BUILD_TYPE=Release ^ 401 -DCMAKE_BUILD_TYPE=Release ^
@@ -411,7 +411,7 @@ jobs:
411 copy /Y "${{ env.LUAROCKS_DEPS_DIR }}\lib\bz2.dll" ^ 411 copy /Y "${{ env.LUAROCKS_DEPS_DIR }}\lib\bz2.dll" ^
412 "${{ env.LUAROCKS_DEPS_DIR }}\bin" 412 "${{ env.LUAROCKS_DEPS_DIR }}\bin"
413 ) 413 )
414 414
415 - name: Restore OpenSSL installer 415 - name: Restore OpenSSL installer
416 if: ${{ matrix.COMPILER == 'vs' }} 416 if: ${{ matrix.COMPILER == 'vs' }}
417 id: restore-openssl-installer 417 id: restore-openssl-installer
@@ -419,7 +419,7 @@ jobs:
419 with: 419 with:
420 path: build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe 420 path: build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe
421 key: openssl-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }} 421 key: openssl-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}
422 422
423 # On Windows, up to date (OpenSSL 3.4.1), the process 423 # On Windows, up to date (OpenSSL 3.4.1), the process
424 # to build OpenSSL from source code is quite slow (20min ~ 30min). 424 # to build OpenSSL from source code is quite slow (20min ~ 30min).
425 # In order to get pre-built binaries (CI purposes) for the OpenSSL library 425 # In order to get pre-built binaries (CI purposes) for the OpenSSL library
@@ -441,7 +441,7 @@ jobs:
441 $installerName = "${{ github.workspace }}\build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe"; 441 $installerName = "${{ github.workspace }}\build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe";
442 442
443 $arch = 'INTEL'; 443 $arch = 'INTEL';
444 444
445 if ("${{ matrix.ARCH }}" -eq "x86") 445 if ("${{ matrix.ARCH }}" -eq "x86")
446 { 446 {
447 $bits = '32'; 447 $bits = '32';
@@ -482,7 +482,7 @@ jobs:
482 # Validate sha512 checksum 482 # Validate sha512 checksum
483 $downloadedHash = Get-FileHash -Path "${installerName}" -Algorithm "SHA512" | 483 $downloadedHash = Get-FileHash -Path "${installerName}" -Algorithm "SHA512" |
484 Select-Object -ExpandProperty Hash; 484 Select-Object -ExpandProperty Hash;
485 485
486 $downloadedHash = $downloadedHash.Replace("-", "").ToLower(); 486 $downloadedHash = $downloadedHash.Replace("-", "").ToLower();
487 487
488 if ("${downloadedHash}" -ne "${installerHash}") 488 if ("${downloadedHash}" -ne "${installerHash}")
@@ -496,7 +496,7 @@ jobs:
496 with: 496 with:
497 path: build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe 497 path: build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe
498 key: openssl-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }} 498 key: openssl-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}
499 499
500 - name: Install dependency (OpenSSL) 500 - name: Install dependency (OpenSSL)
501 if: ${{ matrix.COMPILER == 'vs' }} 501 if: ${{ matrix.COMPILER == 'vs' }}
502 shell: pwsh 502 shell: pwsh
@@ -505,7 +505,7 @@ jobs:
505 -FilePath "${{ github.workspace }}\build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe" ` 505 -FilePath "${{ github.workspace }}\build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe" `
506 -ArgumentList "/verysilent", "/sp-", "/suppressmsgboxes", "/DIR=`"${{ env.LUAROCKS_DEPS_DIR }}`"" ` 506 -ArgumentList "/verysilent", "/sp-", "/suppressmsgboxes", "/DIR=`"${{ env.LUAROCKS_DEPS_DIR }}`"" `
507 -Wait; 507 -Wait;
508 508
509 $deps_lib_dir = Join-Path -Path "${{ env.LUAROCKS_DEPS_DIR }}" -ChildPath "lib"; 509 $deps_lib_dir = Join-Path -Path "${{ env.LUAROCKS_DEPS_DIR }}" -ChildPath "lib";
510 if (Test-Path -Path $deps_lib_dir) 510 if (Test-Path -Path $deps_lib_dir)
511 { 511 {
@@ -517,7 +517,7 @@ jobs:
517 $current_imp_lib = Get-ChildItem -Path $deps_lib_dir -Recurse -File | 517 $current_imp_lib = Get-ChildItem -Path $deps_lib_dir -Recurse -File |
518 Where-Object Name -EQ "${imp_lib}" | 518 Where-Object Name -EQ "${imp_lib}" |
519 Select-Object -ExpandProperty FullName -First 1; 519 Select-Object -ExpandProperty FullName -First 1;
520 520
521 Copy-Item -Path $current_imp_lib -Destination $deps_lib_dir; 521 Copy-Item -Path $current_imp_lib -Destination $deps_lib_dir;
522 } 522 }
523 } 523 }
@@ -535,23 +535,23 @@ jobs:
535 mingw-w64-ucrt-x86_64-zlib ^ 535 mingw-w64-ucrt-x86_64-zlib ^
536 mingw-w64-ucrt-x86_64-bzip2 ^ 536 mingw-w64-ucrt-x86_64-bzip2 ^
537 mingw-w64-ucrt-x86_64-openssl 537 mingw-w64-ucrt-x86_64-openssl
538 538
539 SET "TRIES=0" 539 SET "TRIES=0"
540 SET "MAX_TRIES=5" 540 SET "MAX_TRIES=5"
541 SET "SECS_TO_WAIT=1" 541 SET "SECS_TO_WAIT=1"
542 542
543 GOTO :INSTALL_FROM_MSYS2 543 GOTO :INSTALL_FROM_MSYS2
544 544
545 :INSTALL_FROM_MSYS2 545 :INSTALL_FROM_MSYS2
546 C:\msys64\usr\bin\bash "-lc" ^ 546 C:\msys64\usr\bin\bash "-lc" ^
547 "pacman -S %PKGS_TO_INSTALL% --noconfirm" 547 "pacman -S %PKGS_TO_INSTALL% --noconfirm"
548 548
549 IF %ERRORLEVEL% EQU 0 ( 549 IF %ERRORLEVEL% EQU 0 (
550 echo C:\msys64\ucrt64\bin>>${{ github.path }} 550 echo C:\msys64\ucrt64\bin>>${{ github.path }}
551 ) ELSE ( 551 ) ELSE (
552 SET /A "TRIES=TRIES+1" 552 SET /A "TRIES=TRIES+1"
553 IF %TRIES% LSS %MAX_TRIES% ( 553 IF %TRIES% LSS %MAX_TRIES% (
554 echo Attempt %TRIES% out of %MAX_TRIES% to install packages failed 554 echo Attempt %TRIES% out of %MAX_TRIES% to install packages failed
555 SET /A "SECS_TO_WAIT*=2" 555 SET /A "SECS_TO_WAIT*=2"
556 echo Waiting %SECS_TO_WAIT% seconds to retry 556 echo Waiting %SECS_TO_WAIT% seconds to retry
557 SLEEP %SECS_TO_WAIT% 557 SLEEP %SECS_TO_WAIT%
@@ -561,21 +561,21 @@ jobs:
561 EXIT /B 1 561 EXIT /B 1
562 ) 562 )
563 ) 563 )
564 564
565 - name: Setup Python 565 - name: Setup Python
566 uses: actions/setup-python@v5 566 uses: actions/setup-python@v5
567 with: 567 with:
568 # employ the latest Python version 568 # employ the latest Python version
569 # described at https://pypi.org/project/hererocks/ 569 # described at https://pypi.org/project/hererocks/
570 python-version: '3.11' 570 python-version: '3.11'
571 571
572 - name: Install SSL certificate 572 - name: Install SSL certificate
573 run: | 573 run: |
574 pip install --upgrade certifi 574 pip install --upgrade certifi
575 FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "import certifi;print(certifi.where())"`) DO ( 575 FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "import certifi;print(certifi.where())"`) DO (
576 echo SSL_CERT_FILE=%%F>>${{ github.env }} 576 echo SSL_CERT_FILE=%%F>>${{ github.env }}
577 ) 577 )
578 578
579 - name: Install ${{ matrix.LUAT }} ${{ matrix.LUAV }} 579 - name: Install ${{ matrix.LUAT }} ${{ matrix.LUAV }}
580 run: | 580 run: |
581 SET "CURRENT_LUA_DIRNAME=lua_install-${{ matrix.LUAV }}" 581 SET "CURRENT_LUA_DIRNAME=lua_install-${{ matrix.LUAV }}"
@@ -589,7 +589,7 @@ jobs:
589 "--${{ matrix.LUAT }}" "${{ matrix.LUAV }}" ^ 589 "--${{ matrix.LUAT }}" "${{ matrix.LUAV }}" ^
590 --luarocks latest ^ 590 --luarocks latest ^
591 "--target=${{ matrix.COMPILER }}" 591 "--target=${{ matrix.COMPILER }}"
592 592
593 IF %ERRORLEVEL% NEQ 0 ( 593 IF %ERRORLEVEL% NEQ 0 (
594 echo Failed to install Lua / LuaRocks 594 echo Failed to install Lua / LuaRocks
595 EXIT /B 1 595 EXIT /B 1
@@ -608,25 +608,25 @@ jobs:
608 SET MSVCRT_LUA_CODE=local pe = require [[win32.pe-parser]]; ^ 608 SET MSVCRT_LUA_CODE=local pe = require [[win32.pe-parser]]; ^
609 local rt, _ = pe.msvcrt [[${{ env.CURRENT_LUA_INTERPRETER }}]]; ^ 609 local rt, _ = pe.msvcrt [[${{ env.CURRENT_LUA_INTERPRETER }}]]; ^
610 print(rt or 'nil') 610 print(rt or 'nil')
611 611
612 FOR /F "tokens=* USEBACKQ" %%I IN (`lua -e "%MSVCRT_LUA_CODE%"`) DO ( 612 FOR /F "tokens=* USEBACKQ" %%I IN (`lua -e "%MSVCRT_LUA_CODE%"`) DO (
613 IF NOT "%%I"=="nil" ( 613 IF NOT "%%I"=="nil" (
614 luarocks config variables.MSVCRT "%%I" 614 luarocks config variables.MSVCRT "%%I"
615 ) 615 )
616 ) 616 )
617 617
618 - name: Install compat53 618 - name: Install compat53
619 run: luarocks install compat53 619 run: luarocks install compat53
620 620
621 - name: Install busted 621 - name: Install busted
622 run: IF NOT EXIST "${{ env.BUSTED_BAT }}" luarocks install busted 622 run: IF NOT EXIST "${{ env.BUSTED_BAT }}" luarocks install busted
623 623
624 - name: Install cluacov 624 - name: Install cluacov
625 run: IF NOT EXIST "${{ env.LUACOV_BAT }}" luarocks install cluacov 625 run: IF NOT EXIST "${{ env.LUACOV_BAT }}" luarocks install cluacov
626 626
627 - name: Install busted-htest 627 - name: Install busted-htest
628 run: luarocks install busted-htest 628 run: luarocks install busted-htest
629 629
630 - name: Run test 630 - name: Run test
631 run: | 631 run: |
632 busted ^ 632 busted ^
@@ -636,7 +636,7 @@ jobs:
636 -Xhelper ^ 636 -Xhelper ^
637 "lua_dir=${{ env.CURRENT_LUA_DIR }},${{ env.LUAROCKS_WINDOWS_GH_CI }},${{ matrix.COMPILER }}" ^ 637 "lua_dir=${{ env.CURRENT_LUA_DIR }},${{ env.LUAROCKS_WINDOWS_GH_CI }},${{ matrix.COMPILER }}" ^
638 ${{ matrix.FILES }} 638 ${{ matrix.FILES }}
639 639
640 - name: Run unit test 640 - name: Run unit test
641 if: ${{ matrix.TESTTYPE == 'unit' }} 641 if: ${{ matrix.TESTTYPE == 'unit' }}
642 run: | 642 run: |
@@ -647,16 +647,16 @@ jobs:
647 -Xhelper ^ 647 -Xhelper ^
648 "lua_dir=${{ env.CURRENT_LUA_DIR }},${{ env.LUAROCKS_WINDOWS_GH_CI }},${{ matrix.COMPILER }},env=full" ^ 648 "lua_dir=${{ env.CURRENT_LUA_DIR }},${{ env.LUAROCKS_WINDOWS_GH_CI }},${{ matrix.COMPILER }},env=full" ^
649 ${{ matrix.FILES }} 649 ${{ matrix.FILES }}
650 650
651 - name: Generate coverage report 651 - name: Generate coverage report
652 working-directory: testrun 652 working-directory: testrun
653 run: luacov -c "luacov.config" 653 run: luacov -c "luacov.config"
654 654
655 - name: Install Codecov 655 - name: Install Codecov
656 run: pip install codecov 656 run: pip install codecov
657 657
658 - name: Upload coverage report 658 - name: Upload coverage report
659 working-directory: testrun 659 working-directory: testrun
660 env: 660 env:
661 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 661 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
662 run: codecov -t "%CODECOV_TOKEN%" -f "luacov.report.out" -X gcov \ No newline at end of file 662 run: codecov -t "%CODECOV_TOKEN%" -f "luacov.report.out" -X gcov