@@ -147,36 +147,30 @@ runs:
147147 steps :
148148 # Target: none
149149 # Shared step to do initial set up
150- - name : initial setup
150+ - name : set SYSTEM_CORES (Linux)
151+ shell : bash
152+ if : runner.os == 'Linux'
153+ run : echo SYSTEM_CORES="$(grep -c ^processor /proc/cpuinfo 2>/dev/null || echo 1 )" >> $GITHUB_ENV
154+ - name : set SYSTEM_CORES (macOS)
155+ shell : bash
156+ if : runner.os == 'macOS'
157+ run : echo SYSTEM_CORES="$(sysctl -n hw.ncpu || echo 1)" >> $GITHUB_ENV
158+ - name : set SYSTEM_CORES (Windows)
159+ shell : bash
160+ if : runner.os == 'Windows'
161+ run : echo SYSTEM_CORES=$( powershell -NoProfile -Command "& { Get-WmiObject Win32_Processor | Select-Object -Property NumberOfCores }" | perl -0777 -ne 'print $1, "\n" while /(\d+)/g' ) >> $GITHUB_ENV
162+ - name : set MAKEFLAGS
151163 shell : bash
152164 run : |
153- echo "::group::initial setup"
154- export SYSTEM_CORES=1;
155- if ${{ toJSON( runner.os == 'Linux' ) }}; then
156- export SYSTEM_CORES="$(grep -c ^processor /proc/cpuinfo 2>/dev/null || echo 1 )"
157- elif ${{ toJSON( runner.os == 'macOS' ) }}; then
158- export SYSTEM_CORES="$(sysctl -n hw.ncpu || echo 1)"
159- elif ${{ toJSON( runner.os == 'Windows' ) }}; then
160- export SYSTEM_CORES=$( powershell -NoProfile -Command "& { Get-WmiObject Win32_Processor | Select-Object -Property NumberOfCores }" | perl -0777 -ne 'print $1, "\n" while /(\d+)/g' );
161- fi
162- echo "SYSTEM_CORES=$SYSTEM_CORES" >> $GITHUB_ENV
163- if ${{ toJSON(
164- fromJSON(inputs.build-enable-parallel || 'true')
165- ) }}; then
166- echo "MAKEFLAGS=-j$(( SYSTEM_CORES + 1))" >> $GITHUB_ENV
167- fi
168-
169- #if ${{ toJSON( runner.os == 'Windows' ) }}; then
170- # # Set TEMP to full path instead of 8.3 short filenames.
171- # # See <https://github.com/actions/virtual-environments/issues/712>.
172- # # $USERPROFILE\\AppData\\Local\\Temp
173- # [ -d 'C:\tmp' ] || mkdir 'C:\tmp';
174- # echo 'TMP=C:\tmp' >> $GITHUB_ENV
175- # echo 'TEMP=C:\tmp' >> $GITHUB_ENV
176- #fi
165+ if ${{ toJSON(fromJSON(inputs.build-enable-parallel || 'true')) }}; then
166+ echo "MAKEFLAGS=-j$(( SYSTEM_CORES + 1))" >> $GITHUB_ENV
167+ fi
177168
169+ - name : setup Clang noise suppression (MacOS)
170+ shell : bash
178171 # This is needed for Clang 12 due to
179172 # <https://github.com/Perl/perl5/issues/18780>.
173+ echo "::group::setup Clang noise suppression (MacOS)"
180174 if ${{ toJSON( runner.os == 'macOS' ) }}; then
181175 PATCH_EUMM_DIR=$HOME/build_aux
182176 [ -d $PATCH_EUMM_DIR ] || mkdir $PATCH_EUMM_DIR
@@ -199,7 +193,7 @@ runs:
199193 ) }}; then
200194 if ${{ toJSON( runner.os == 'Linux' ) }}; then
201195 echo "::group::Install xvfb (via apt-get)"
202- sudo apt-get install xvfb
196+ sudo apt-get install --no-install-recommends -y xvfb
203197 mkdir /tmp/runtime-runner && chmod 0700 /tmp/runtime-runner
204198 echo "XDG_RUNTIME_DIR=/tmp/runtime-runner" >> $GITHUB_ENV
205199 if ${{ fromJSON(inputs.build-enable-graphical-display || 'false') }}; then
@@ -257,7 +251,7 @@ runs:
257251 )
258252 uses : actions/cache@v4
259253 with :
260- key : locallib-v2.${{ inputs.perl-deps-cache-version }}-${{ runner.os }}-${{ env.GHA_CACHE_PERL_V_HASH }}
254+ key : locallib-v2.${{ inputs.perl-deps-cache-version }}-${{ runner.os }}-${{ inputs.perl-version }}-${{ env.GHA_CACHE_PERL_V_HASH }}
261255 path : ~/perl5
262256 - name : target-setup-perl (ccache)
263257 # ccache support on Windows is not well-tested
@@ -284,8 +278,8 @@ runs:
284278 ) }}; then
285279 echo "::group::setup-perl (setup local::lib)"
286280 # older Perls need this upgrade
287- $MYPERL -S cpanm -n --local-lib=~/perl5 ExtUtils::MakeMaker
288- $MYPERL -S cpanm -n --local-lib=~/perl5 local::lib
281+ $MYPERL -S cpanm -n --local-lib=~/perl5 ExtUtils::MakeMaker || ( cat ~/.cpanm/build.log && false )
282+ $MYPERL -S cpanm -n --local-lib=~/perl5 local::lib || ( cat ~/.cpanm/build.log && false )
289283 LOCALLIB_VARS="$($MYPERL -I ~/perl5/lib/perl5 -Mlocal::lib=--shelltype,bourne )"
290284 eval $( echo "$LOCALLIB_VARS" | $MYPERL -MFile::Spec -pne '
291285 $_ = "" if /^PATH=/;
@@ -334,8 +328,8 @@ runs:
334328 ) }}; then
335329 echo "::group::test-release-testing (via cpanm)"
336330 cd ${{ inputs.path }}
337- $BUILD_RUNNER_PREFIX $MYPERL -S cpanm -n --installdeps --with-develop . || cat ~/.cpanm/build.log
338- $BUILD_RUNNER_PREFIX $MYPERL -S cpanm -n CPAN::Changes || cat ~/.cpanm/build.log
331+ $BUILD_RUNNER_PREFIX $MYPERL -S cpanm -n --installdeps --with-develop . || ( cat ~/.cpanm/build.log && false )
332+ $BUILD_RUNNER_PREFIX $MYPERL -S cpanm -n CPAN::Changes || ( cat ~/.cpanm/build.log && false )
339333 if [ -d xt ]; then
340334 $TEST_RUNNER_PREFIX $MYPERL -S prove -lr xt
341335 else
@@ -366,11 +360,14 @@ runs:
366360 fi
367361 echo "::endgroup::"
368362 fi
369- - name : GNU make for Windows
363+ - name : set MYMAKE ( Windows)
370364 shell : bash
371- if : ${{ matrix.os == 'windows-latest' }}
372- run : |
373- choco install --verbose make
365+ if : runner.os == 'Windows'
366+ run : echo MYMAKE=gmake >> $GITHUB_ENV
367+ - name : set MYMAKE (non-Windows)
368+ shell : bash
369+ if : runner.os != 'Windows'
370+ run : echo MYMAKE=make >> $GITHUB_ENV
374371 - name : target-test (no coverage)
375372 shell : bash
376373 env :
@@ -388,7 +385,7 @@ runs:
388385 if [ -f Makefile.PL ]; then
389386 ( $TEST_RUNNER_PREFIX make && $TEST_RUNNER_PREFIX make test ) || exit 1
390387 elif [ -f Build.PL ]; then
391- ( $TEST_RUNNER_PREFIX ./ Build test ) || exit 1
388+ ( $TEST_RUNNER_PREFIX $MYPERL Build test ) || exit 1
392389 else
393390 echo "No file Makefile.PL or Build.PL" >&2
394391 fi
@@ -409,8 +406,8 @@ runs:
409406 ) }}; then
410407 echo "::group::test (with coverage)"
411408 cd ${{ inputs.path }}
412- $MYPERL -S cpanm -n Devel::Cover::Report::Coveralls || cat ~/.cpanm/build.log
413- $MYPERL -S cpanm -n git ://github.com/PDLPorters/Devel--Cover.git@patches || cat ~/.cpanm/build.log
409+ $MYPERL -S cpanm -n Devel::Cover::Report::Coveralls || ( cat ~/.cpanm/build.log && false )
410+ $MYPERL -S cpanm -n https ://github.com/PDLPorters/Devel--Cover.git@patches || ( cat ~/.cpanm/build.log && false )
414411 $TEST_RUNNER_PREFIX $MYPERL -S cover -test -relative_only -gcov_chdir -report Coveralls
415412 echo "::endgroup::"
416413 fi
0 commit comments