diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcbf592e..e0f10ede 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: with: { submodules: true } - name: 'Rebuild and verify stubs' run: | - export PATH="$(readlink -fn ../deps/bin-upx-20221212/.):$PATH" + export PATH="$(readlink -en ../deps/bin-upx-20221212):$PATH" make -C src/stub maintainer-clean extra-clean git status || true make -C src/stub extra-all all @@ -52,7 +52,7 @@ jobs: - name: 'Check source code formatting' run: | bash ./misc/scripts/check_whitespace_git.sh - env UPX_CLANG_FORMAT="$PWD/../deps/bin-upx-20221212/clang-format-15.0.6" make -C src clang-format + UPX_CLANG_FORMAT="$PWD/../deps/bin-upx-20221212/clang-format-15.0.6" make -C src clang-format if ! git diff --quiet; then git diff; exit 1; fi job-linux-cmake: @@ -77,7 +77,7 @@ jobs: uses: actions/checkout@v3 with: { submodules: true } - name: 'Check out test suite' - run: 'mkdir ../deps && git -C ../deps clone --depth=1 https://github.com/upx/upx-testsuite' + run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite' - name: 'Build cmake debug-gcc' run: 'make build/debug-gcc' - name: 'Build cmake release-gcc' @@ -116,10 +116,11 @@ jobs: run: | make -C build/debug-gcc-m32 test make -C build/release-gcc-m32 test - - name: 'Run test suite release-gcc' + - name: 'Run test suite build/release-gcc' run: | - export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite) - (cd build/release-gcc && env upx_exe=./upx bash ../../.github/travis_testsuite_1.sh) + export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" + testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh) + env -C build/release-gcc upx_exe=./upx bash "$testsuite_1" job-macos-cmake: needs: [ job-rebuild-and-verify-stubs ] @@ -129,15 +130,20 @@ jobs: fail-fast: false matrix: include: - - { os: macos-11, gcc: gcc-10, gxx: 'g++-10' } - # { os: macos-12, gcc: gcc-11, gxx: 'g++-11' } # disable gcc - XCode 14.0 ld bug; supposed to be fixed in 14.1 - - { os: macos-12 } + - { os: macos-11, gcc: gcc-10, gxx: 'g++-10', testsuite: true } + # { os: macos-12, gcc: gcc-11, gxx: 'g++-11', testsuite: true } # disable gcc - XCode 14.0 ld bug; supposed to be fixed in 14.1 + - { os: macos-12, testsuite: true } steps: + - name: 'Install brew packages' + if: ${{ matrix.testsuite }} + run: | + brew update + brew install coreutils - name: 'Check out code' uses: actions/checkout@v3 with: { submodules: true } - name: 'Check out test suite' - run: 'mkdir ../deps && git -C ../deps clone --depth=1 https://github.com/upx/upx-testsuite' + run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite' - name: 'Build cmake debug-gcc' if: ${{ matrix.gcc != '' }} run: 'make build/debug-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}' @@ -165,6 +171,13 @@ jobs: run: | make -C build/debug-clang test make -C build/release-clang test + - name: 'Run test suite build/release-clang' + if: ${{ matrix.testsuite }} + run: | + export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" + export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" + testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh) + env -C build/release-clang upx_exe=./upx bash "$testsuite_1" job-windows-cmake: needs: [ job-rebuild-and-verify-stubs ] @@ -184,8 +197,7 @@ jobs: uses: actions/checkout@v3 with: { submodules: true } - name: 'Check out test suite' - shell: bash - run: 'mkdir ../deps && git -C ../deps clone --depth=1 https://github.com/upx/upx-testsuite' + run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite' - name: 'Inspect runner-image settings' # see https://github.com/actions/runner-images.git if: ${{ false }} @@ -217,8 +229,9 @@ jobs: - name: 'Run test suite build/release' shell: bash run: | - export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite) - (cd build/release/Release && env upx_exe=./upx.exe bash ../../../.github/travis_testsuite_1.sh) + export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" + testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh) + env -C build/release/Release upx_exe=./upx bash "$testsuite_1" job-windows-toolchains: needs: [ job-rebuild-and-verify-stubs ] @@ -227,7 +240,7 @@ jobs: env: C: ${{ matrix.C }} B: release - H: 'd:\a\upx' + H: 'd:\a\upx\upx' strategy: fail-fast: false matrix: @@ -241,14 +254,12 @@ jobs: uses: actions/checkout@v3 with: { submodules: true } - name: 'Prepare sources and Check out test suite' - shell: cmd + shell: bash run: | - where bash & where cat & where chmod & where cmp & where cp & where curl & where date & where file & where git & where gzip & where mkdir & where mv & where openssl & where readlink & where rm & where rmdir & where sed & where sha256sum & where sort & where ssh & where ssh-add & where ssh-agent & where ssh-keyscan & where tar & where touch git config --global core.autocrlf input - git --version & bash --version - cd %H% - md build build\%C% deps - git -C deps clone --depth=1 https://github.com/upx/upx-testsuite + git --version && bash --version + git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite + mkdir -p -v build/$C/$B/{ucl,upx,zlib} - name: 'Set up Developer Command Prompt' uses: ilammy/msvc-dev-cmd@v1 with: @@ -259,30 +270,29 @@ jobs: @REM setup directories where cl & where link set BDIR=%H%\build\%C%\%B% - md %BDIR% %BDIR%\ucl %BDIR%\upx %BDIR%\upx-testsuite %BDIR%\zlib set DEFS=-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS git rev-parse --short=12 HEAD > %BDIR%\upx\.GITREV.txt @REM ===== build UCL ===== cd %BDIR%\ucl - set s=%H%\upx\vendor\ucl - cl -MT -J -O2 -W4 %DEFS% -I%s%\include -I%s% -c %s%\src\*.c + set s=%H%\vendor\ucl + cl -MT -J -O2 -W4 -WX %DEFS% -I%s%\include -I%s% -c %s%\src\*.c link -lib -out:ucl.lib *.obj @REM ===== build zlib ===== cd %BDIR%\zlib - cl -MT -J -O2 -W3 %DEFS% -c %H%\upx\vendor\zlib\*.c + cl -MT -J -O2 -W3 -WX %DEFS% -c %H%\vendor\zlib\*.c link -lib -out:zlib.lib *.obj @REM ===== build UPX ===== cd %BDIR%\upx - set s=%H%\upx\src + set s=%H%\src cat .GITREV.txt set /p GITREV=<.GITREV.txt - cl -MT -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -I%H%\upx\vendor -Feupx.exe %s%\*.cpp %s%\util\*.cpp %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link setargv.obj + cl -MT -EHsc -J -O2 -W4 -WX -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% -I%H%\vendor -Feupx.exe %s%\*.cpp %s%\util\*.cpp %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib /link setargv.obj - name: 'Make artifact' shell: bash run: | N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.name }} mkdir -p "tmp/artifact/$N/$B" - cp -ai ../build/$C/$B/upx/upx*.exe "tmp/artifact/$N/$B" + cp -ai build/$C/$B/upx/upx*.exe "tmp/artifact/$N/$B" # GitHub Actions magic: set "artifact_name" environment value for use in next step echo "artifact_name=$N" >> $GITHUB_ENV - name: ${{ format('Upload artifact {0}', env.artifact_name) }} @@ -305,7 +315,8 @@ jobs: - name: 'Run test suite' shell: bash run: | - export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite) - (cd ../build/$C/$B/upx && env upx_exe=./upx.exe bash ../../../../upx/.github/travis_testsuite_1.sh) + export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)" + testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh) + env -C build/$C/$B/upx upx_exe=./upx.exe bash "$testsuite_1" # vim:set ts=2 sw=2 et: diff --git a/.gitignore b/.gitignore index ebff394d..4275a77e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,11 +5,10 @@ /maint* /vendor* -.depend GNUmakefile MMakefile Makevars.local* -tmp-testsuite* +tmp* *.a *.d