1
0
mirror of https://github.com/upx/upx.git synced 2025-08-07 22:46:51 +08:00

CI: update CI

This commit is contained in:
Markus F.X.J. Oberhumer
2022-12-21 10:08:21 +01:00
parent 708ab1dcd7
commit 0ac3cb2329
2 changed files with 42 additions and 32 deletions

View File

@ -44,7 +44,7 @@ jobs:
with: { submodules: true } with: { submodules: true }
- name: 'Rebuild and verify stubs' - name: 'Rebuild and verify stubs'
run: | 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 make -C src/stub maintainer-clean extra-clean
git status || true git status || true
make -C src/stub extra-all all make -C src/stub extra-all all
@ -52,7 +52,7 @@ jobs:
- name: 'Check source code formatting' - name: 'Check source code formatting'
run: | run: |
bash ./misc/scripts/check_whitespace_git.sh 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 if ! git diff --quiet; then git diff; exit 1; fi
job-linux-cmake: job-linux-cmake:
@ -77,7 +77,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: { submodules: true } with: { submodules: true }
- name: 'Check out test suite' - 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' - name: 'Build cmake debug-gcc'
run: 'make build/debug-gcc' run: 'make build/debug-gcc'
- name: 'Build cmake release-gcc' - name: 'Build cmake release-gcc'
@ -116,10 +116,11 @@ jobs:
run: | run: |
make -C build/debug-gcc-m32 test make -C build/debug-gcc-m32 test
make -C build/release-gcc-m32 test make -C build/release-gcc-m32 test
- name: 'Run test suite release-gcc' - name: 'Run test suite build/release-gcc'
run: | run: |
export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite) export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
(cd build/release-gcc && env upx_exe=./upx bash ../../.github/travis_testsuite_1.sh) testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh)
env -C build/release-gcc upx_exe=./upx bash "$testsuite_1"
job-macos-cmake: job-macos-cmake:
needs: [ job-rebuild-and-verify-stubs ] needs: [ job-rebuild-and-verify-stubs ]
@ -129,15 +130,20 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- { os: macos-11, gcc: gcc-10, gxx: 'g++-10' } - { os: macos-11, gcc: gcc-10, gxx: 'g++-10', testsuite: true }
# { 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, 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 } - { os: macos-12, testsuite: true }
steps: steps:
- name: 'Install brew packages'
if: ${{ matrix.testsuite }}
run: |
brew update
brew install coreutils
- name: 'Check out code' - name: 'Check out code'
uses: actions/checkout@v3 uses: actions/checkout@v3
with: { submodules: true } with: { submodules: true }
- name: 'Check out test suite' - 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' - name: 'Build cmake debug-gcc'
if: ${{ matrix.gcc != '' }} if: ${{ matrix.gcc != '' }}
run: 'make build/debug-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}' run: 'make build/debug-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
@ -165,6 +171,13 @@ jobs:
run: | run: |
make -C build/debug-clang test make -C build/debug-clang test
make -C build/release-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: job-windows-cmake:
needs: [ job-rebuild-and-verify-stubs ] needs: [ job-rebuild-and-verify-stubs ]
@ -184,8 +197,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: { submodules: true } with: { submodules: true }
- name: 'Check out test suite' - name: 'Check out test suite'
shell: bash run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite'
run: 'mkdir ../deps && git -C ../deps clone --depth=1 https://github.com/upx/upx-testsuite'
- name: 'Inspect runner-image settings' - name: 'Inspect runner-image settings'
# see https://github.com/actions/runner-images.git # see https://github.com/actions/runner-images.git
if: ${{ false }} if: ${{ false }}
@ -217,8 +229,9 @@ jobs:
- name: 'Run test suite build/release' - name: 'Run test suite build/release'
shell: bash shell: bash
run: | run: |
export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite) export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
(cd build/release/Release && env upx_exe=./upx.exe bash ../../../.github/travis_testsuite_1.sh) testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh)
env -C build/release/Release upx_exe=./upx bash "$testsuite_1"
job-windows-toolchains: job-windows-toolchains:
needs: [ job-rebuild-and-verify-stubs ] needs: [ job-rebuild-and-verify-stubs ]
@ -227,7 +240,7 @@ jobs:
env: env:
C: ${{ matrix.C }} C: ${{ matrix.C }}
B: release B: release
H: 'd:\a\upx' H: 'd:\a\upx\upx'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -241,14 +254,12 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: { submodules: true } with: { submodules: true }
- name: 'Prepare sources and Check out test suite' - name: 'Prepare sources and Check out test suite'
shell: cmd shell: bash
run: | 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 config --global core.autocrlf input
git --version & bash --version git --version && bash --version
cd %H% git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
md build build\%C% deps mkdir -p -v build/$C/$B/{ucl,upx,zlib}
git -C deps clone --depth=1 https://github.com/upx/upx-testsuite
- name: 'Set up Developer Command Prompt' - name: 'Set up Developer Command Prompt'
uses: ilammy/msvc-dev-cmd@v1 uses: ilammy/msvc-dev-cmd@v1
with: with:
@ -259,30 +270,29 @@ jobs:
@REM setup directories @REM setup directories
where cl & where link where cl & where link
set BDIR=%H%\build\%C%\%B% 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 set DEFS=-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS
git rev-parse --short=12 HEAD > %BDIR%\upx\.GITREV.txt git rev-parse --short=12 HEAD > %BDIR%\upx\.GITREV.txt
@REM ===== build UCL ===== @REM ===== build UCL =====
cd %BDIR%\ucl cd %BDIR%\ucl
set s=%H%\upx\vendor\ucl set s=%H%\vendor\ucl
cl -MT -J -O2 -W4 %DEFS% -I%s%\include -I%s% -c %s%\src\*.c cl -MT -J -O2 -W4 -WX %DEFS% -I%s%\include -I%s% -c %s%\src\*.c
link -lib -out:ucl.lib *.obj link -lib -out:ucl.lib *.obj
@REM ===== build zlib ===== @REM ===== build zlib =====
cd %BDIR%\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 link -lib -out:zlib.lib *.obj
@REM ===== build UPX ===== @REM ===== build UPX =====
cd %BDIR%\upx cd %BDIR%\upx
set s=%H%\upx\src set s=%H%\src
cat .GITREV.txt cat .GITREV.txt
set /p GITREV=<.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' - name: 'Make artifact'
shell: bash shell: bash
run: | run: |
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.name }} N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.name }}
mkdir -p "tmp/artifact/$N/$B" 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 # GitHub Actions magic: set "artifact_name" environment value for use in next step
echo "artifact_name=$N" >> $GITHUB_ENV echo "artifact_name=$N" >> $GITHUB_ENV
- name: ${{ format('Upload artifact {0}', env.artifact_name) }} - name: ${{ format('Upload artifact {0}', env.artifact_name) }}
@ -305,7 +315,8 @@ jobs:
- name: 'Run test suite' - name: 'Run test suite'
shell: bash shell: bash
run: | run: |
export upx_testsuite_SRCDIR=$(readlink -en ../deps/upx-testsuite) 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) 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: # vim:set ts=2 sw=2 et:

3
.gitignore vendored
View File

@ -5,11 +5,10 @@
/maint* /maint*
/vendor* /vendor*
.depend
GNUmakefile GNUmakefile
MMakefile MMakefile
Makevars.local* Makevars.local*
tmp-testsuite* tmp*
*.a *.a
*.d *.d