From 8ba26746be59901a8ee4a161e2e376942c3fb647 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sun, 9 Mar 2025 20:25:38 -0300 Subject: ci: enable on main branch --- .github/workflows/test.yml | 72 +++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to '.github') 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 on: push: - branches: master + branches: main pull_request: branches: '*' workflow_dispatch: @@ -235,7 +235,7 @@ jobs: EXCLUDE: "" TESTTYPE: "" ARCH: x86 - + # # MinGW-w64 with Universal C Run Time # provided by MSYS2 @@ -308,7 +308,7 @@ jobs: - name: Add bin directory of dependencies to system PATH environment variable if: ${{ matrix.COMPILER == 'vs' }} run: echo ${{ env.LUAROCKS_DEPS_DIR }}\bin>>${{ github.path }} - + - name: Restore zlib tarball if: ${{ matrix.COMPILER == 'vs' }} id: restore-zlib-tarball @@ -322,20 +322,20 @@ jobs: run: | curl -o "${{ github.workspace }}\zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz" ^ "https://zlib.net/zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz" - + - name: Save zlib tarball if: ${{ matrix.COMPILER == 'vs' && steps.restore-zlib-tarball.outputs.cache-hit != 'true' }} uses: actions/cache/save@v4 with: path: zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz key: zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }} - + - name: Install dependency (zlib) if: ${{ matrix.COMPILER == 'vs' }} run: | cd "${{ runner.temp }}" && mkdir zlib && cd zlib && ^ tar -xf "${{ github.workspace }}\zlib-${{ env.LUAROCKS_DEPS_ZLIB_VER }}.tar.gz" - + IF "${{ matrix.COMPILER }}"=="vs" ( SET CMAKE_GENERATOR=NMake Makefiles SET CC=cl @@ -343,7 +343,7 @@ jobs: SET CMAKE_GENERATOR=MinGW Makefiles SET CC=gcc ) - + cmake -G "%CMAKE_GENERATOR%" ^ -DCMAKE_C_COMPILER=%CC% ^ -DCMAKE_BUILD_TYPE=Release ^ @@ -359,7 +359,7 @@ jobs: copy "${{ env.LUAROCKS_DEPS_DIR }}\lib\zlib.lib" ^ "${{ env.LUAROCKS_DEPS_DIR }}\lib\z.lib" ) - + - name: Restore bzip2 tarball if: ${{ matrix.COMPILER == 'vs' }} id: restore-bzip2-tarball @@ -374,7 +374,7 @@ jobs: cd "${{ runner.temp }}" && ^ git clone https://gitlab.com/bzip2/bzip2 && ^ tar -czvf "${{ github.workspace }}\bzip2.tar.gz" bzip2 - + - name: Save bzip2 tarball if: ${{ matrix.COMPILER == 'vs' && steps.restore-bzip2-tarball.outputs.cache-hit != 'true' }} uses: actions/cache/save@v4 @@ -387,7 +387,7 @@ jobs: run: | cd "${{ runner.temp }}" && ^ tar -xf "${{ github.workspace }}\bzip2.tar.gz" - + IF "${{ matrix.COMPILER }}"=="vs" ( SET CMAKE_GENERATOR=NMake Makefiles SET CC=cl @@ -395,7 +395,7 @@ jobs: SET CMAKE_GENERATOR=MinGW Makefiles SET CC=gcc ) - + cmake -G "%CMAKE_GENERATOR%" ^ -DCMAKE_C_COMPILER=%CC% ^ -DCMAKE_BUILD_TYPE=Release ^ @@ -411,7 +411,7 @@ jobs: copy /Y "${{ env.LUAROCKS_DEPS_DIR }}\lib\bz2.dll" ^ "${{ env.LUAROCKS_DEPS_DIR }}\bin" ) - + - name: Restore OpenSSL installer if: ${{ matrix.COMPILER == 'vs' }} id: restore-openssl-installer @@ -419,7 +419,7 @@ jobs: with: path: build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe key: openssl-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }} - + # On Windows, up to date (OpenSSL 3.4.1), the process # to build OpenSSL from source code is quite slow (20min ~ 30min). # In order to get pre-built binaries (CI purposes) for the OpenSSL library @@ -441,7 +441,7 @@ jobs: $installerName = "${{ github.workspace }}\build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe"; $arch = 'INTEL'; - + if ("${{ matrix.ARCH }}" -eq "x86") { $bits = '32'; @@ -482,7 +482,7 @@ jobs: # Validate sha512 checksum $downloadedHash = Get-FileHash -Path "${installerName}" -Algorithm "SHA512" | Select-Object -ExpandProperty Hash; - + $downloadedHash = $downloadedHash.Replace("-", "").ToLower(); if ("${downloadedHash}" -ne "${installerHash}") @@ -496,7 +496,7 @@ jobs: with: path: build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe key: openssl-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }} - + - name: Install dependency (OpenSSL) if: ${{ matrix.COMPILER == 'vs' }} shell: pwsh @@ -505,7 +505,7 @@ jobs: -FilePath "${{ github.workspace }}\build\openssl-installer-${{ env.LUAROCKS_DEPS_OPENSSL_VER }}-${{ matrix.ARCH }}.exe" ` -ArgumentList "/verysilent", "/sp-", "/suppressmsgboxes", "/DIR=`"${{ env.LUAROCKS_DEPS_DIR }}`"" ` -Wait; - + $deps_lib_dir = Join-Path -Path "${{ env.LUAROCKS_DEPS_DIR }}" -ChildPath "lib"; if (Test-Path -Path $deps_lib_dir) { @@ -517,7 +517,7 @@ jobs: $current_imp_lib = Get-ChildItem -Path $deps_lib_dir -Recurse -File | Where-Object Name -EQ "${imp_lib}" | Select-Object -ExpandProperty FullName -First 1; - + Copy-Item -Path $current_imp_lib -Destination $deps_lib_dir; } } @@ -535,23 +535,23 @@ jobs: mingw-w64-ucrt-x86_64-zlib ^ mingw-w64-ucrt-x86_64-bzip2 ^ mingw-w64-ucrt-x86_64-openssl - + SET "TRIES=0" SET "MAX_TRIES=5" SET "SECS_TO_WAIT=1" - + GOTO :INSTALL_FROM_MSYS2 :INSTALL_FROM_MSYS2 C:\msys64\usr\bin\bash "-lc" ^ "pacman -S %PKGS_TO_INSTALL% --noconfirm" - + IF %ERRORLEVEL% EQU 0 ( echo C:\msys64\ucrt64\bin>>${{ github.path }} ) ELSE ( SET /A "TRIES=TRIES+1" IF %TRIES% LSS %MAX_TRIES% ( - echo Attempt %TRIES% out of %MAX_TRIES% to install packages failed + echo Attempt %TRIES% out of %MAX_TRIES% to install packages failed SET /A "SECS_TO_WAIT*=2" echo Waiting %SECS_TO_WAIT% seconds to retry SLEEP %SECS_TO_WAIT% @@ -561,21 +561,21 @@ jobs: EXIT /B 1 ) ) - + - name: Setup Python uses: actions/setup-python@v5 with: # employ the latest Python version # described at https://pypi.org/project/hererocks/ python-version: '3.11' - + - name: Install SSL certificate run: | pip install --upgrade certifi FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "import certifi;print(certifi.where())"`) DO ( echo SSL_CERT_FILE=%%F>>${{ github.env }} ) - + - name: Install ${{ matrix.LUAT }} ${{ matrix.LUAV }} run: | SET "CURRENT_LUA_DIRNAME=lua_install-${{ matrix.LUAV }}" @@ -589,7 +589,7 @@ jobs: "--${{ matrix.LUAT }}" "${{ matrix.LUAV }}" ^ --luarocks latest ^ "--target=${{ matrix.COMPILER }}" - + IF %ERRORLEVEL% NEQ 0 ( echo Failed to install Lua / LuaRocks EXIT /B 1 @@ -608,25 +608,25 @@ jobs: SET MSVCRT_LUA_CODE=local pe = require [[win32.pe-parser]]; ^ local rt, _ = pe.msvcrt [[${{ env.CURRENT_LUA_INTERPRETER }}]]; ^ print(rt or 'nil') - + FOR /F "tokens=* USEBACKQ" %%I IN (`lua -e "%MSVCRT_LUA_CODE%"`) DO ( IF NOT "%%I"=="nil" ( luarocks config variables.MSVCRT "%%I" ) ) - + - name: Install compat53 run: luarocks install compat53 - + - name: Install busted run: IF NOT EXIST "${{ env.BUSTED_BAT }}" luarocks install busted - + - name: Install cluacov run: IF NOT EXIST "${{ env.LUACOV_BAT }}" luarocks install cluacov - + - name: Install busted-htest run: luarocks install busted-htest - + - name: Run test run: | busted ^ @@ -636,7 +636,7 @@ jobs: -Xhelper ^ "lua_dir=${{ env.CURRENT_LUA_DIR }},${{ env.LUAROCKS_WINDOWS_GH_CI }},${{ matrix.COMPILER }}" ^ ${{ matrix.FILES }} - + - name: Run unit test if: ${{ matrix.TESTTYPE == 'unit' }} run: | @@ -647,16 +647,16 @@ jobs: -Xhelper ^ "lua_dir=${{ env.CURRENT_LUA_DIR }},${{ env.LUAROCKS_WINDOWS_GH_CI }},${{ matrix.COMPILER }},env=full" ^ ${{ matrix.FILES }} - + - name: Generate coverage report working-directory: testrun run: luacov -c "luacov.config" - name: Install Codecov run: pip install codecov - + - name: Upload coverage report working-directory: testrun env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: codecov -t "%CODECOV_TOKEN%" -f "luacov.report.out" -X gcov \ No newline at end of file + run: codecov -t "%CODECOV_TOKEN%" -f "luacov.report.out" -X gcov -- cgit v1.2.3-55-g6feb