From ecb3f83e83173149f0a6ceefe4c615eb8ce11dbb Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 1 Nov 2023 11:28:35 +0100 Subject: [PATCH] CI updates --- .github/dependabot.yml | 1 - .github/workflows/weekly-ci-bs-by-hand.yml | 15 +++++++++++++-- .../workflows/weekly-ci-bs-cmake-windows-make.yml | 7 +++++-- .github/workflows/weekly-ci-bs-misc.yml | 8 ++++---- src/check/dt_cxxlib.cpp | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7f2c1870..36dfbdd0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,4 @@ version: 2 - updates: - package-ecosystem: 'github-actions' directory: '/' diff --git a/.github/workflows/weekly-ci-bs-by-hand.yml b/.github/workflows/weekly-ci-bs-by-hand.yml index 68ed9d8c..7921b869 100644 --- a/.github/workflows/weekly-ci-bs-by-hand.yml +++ b/.github/workflows/weekly-ci-bs-by-hand.yml @@ -102,7 +102,7 @@ jobs: # IMPORTANT: do NOT run as user root! chmod a+w . && sudo -u upx bash "$testsuite" - job-by-hand-macos: # uses a POSIX-compliant shell + job-by-hand-macos-clang: # uses a POSIX-compliant shell # ...and also uses a subdirectory "upx with space" in order to detect possible quoting issues if: github.repository_owner == 'upx' strategy: @@ -112,9 +112,18 @@ jobs: - { os: macos-11, run_fs_test: false } # macos-11 does not have "readlink -f" - { os: macos-12, run_fs_test: true } - { os: macos-13, run_fs_test: true } - name: ${{ format('by-hand cc {0}', matrix.os) }} + name: ${{ format('by-hand clang {0}', matrix.os) }} runs-on: ${{ matrix.os }} steps: + - name: 'Install brew packages' + run: | + # install ccache + if ! command -v ccache > /dev/null; then + # only run "brew update" if needed + if ! brew install ccache; then brew update && brew install ccache; fi + fi + xflags="-Wall -Wextra -Werror" + echo -e "CC=ccache clang $xflags\nCXX=ccache clang++ -std=gnu++17 $xflags" >> $GITHUB_ENV - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} run: | git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" @@ -123,6 +132,8 @@ jobs: run: 'top_srcdir="$PWD/upx with space" /bin/sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - name: 'Build by-hand with bash' run: 'top_srcdir="$PWD/upx with space" bash "./upx with space/misc/scripts/build_upx_by_hand.sh"' + - name: 'Build by-hand with zsh' + run: 'top_srcdir="$PWD/upx with space" zsh "./upx with space/misc/scripts/build_upx_by_hand.sh"' - name: 'Run file system test suite' if: ${{ matrix.run_fs_test }} run: | diff --git a/.github/workflows/weekly-ci-bs-cmake-windows-make.yml b/.github/workflows/weekly-ci-bs-cmake-windows-make.yml index 32724f09..0cd31e1a 100644 --- a/.github/workflows/weekly-ci-bs-cmake-windows-make.yml +++ b/.github/workflows/weekly-ci-bs-cmake-windows-make.yml @@ -21,7 +21,7 @@ jobs: include: # INFO: the following don't work with GNU make (probably some quoting problems with spaces or backslashes) # => use Ninja generator instead; see weekly-ci-bs-cmake-windows-ninja.yml -# # cl (msvc) +# # cl (MSVC) # - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64 } # - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64_arm64 } # - { os: windows-2019, cc: cl, cxx: cl, vsversion: 2019, arch: amd64_x86 } @@ -29,10 +29,13 @@ jobs: # - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64_arm64 } # - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64_x86 } # # clang-cl +# - { os: windows-2019, cc: clang-cl, cxx: clang-cl, vsversion: 2019, arch: amd64 } # - { os: windows-2022, cc: clang-cl, cxx: clang-cl, vsversion: 2022, arch: amd64 } # clang + - { os: windows-2019, cc: clang, cxx: 'clang++', arch: amd64, xflags: '-static' } - { os: windows-2022, cc: clang, cxx: 'clang++', arch: amd64, xflags: '-static' } # gcc (mingw-gcc) + - { os: windows-2019, cc: gcc, cxx: 'g++', arch: amd64, xflags: '-static' } - { os: windows-2022, cc: gcc, cxx: 'g++', arch: amd64, xflags: '-static' } env: CC: ${{ matrix.cc }} ${{ matrix.xflags }} @@ -52,7 +55,7 @@ jobs: - name: 'Init environment' shell: bash run: | - xtarget="windows-make-${{ matrix.cc }}-${{ matrix.vsversion }}-${{ matrix.arch}}" + xtarget="${{ matrix.os }}-make-${{ matrix.cc }}-${{ matrix.vsversion }}-${{ matrix.arch}}" echo "xtarget=$xtarget" >> $GITHUB_ENV - name: 'Build cmake Make Debug' shell: bash diff --git a/.github/workflows/weekly-ci-bs-misc.yml b/.github/workflows/weekly-ci-bs-misc.yml index ea46c465..a141181f 100644 --- a/.github/workflows/weekly-ci-bs-misc.yml +++ b/.github/workflows/weekly-ci-bs-misc.yml @@ -64,10 +64,10 @@ jobs: esac echo -e "CC=$CC\nCXX=$CXX" >> $GITHUB_ENV - name: 'Build and test Debug' - run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make debug && ctest --test-dir build/debug' + run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make build/debug && ctest --test-dir build/debug' - name: 'Build and test Release' if: success() || failure() # run this step even if the previous step failed - run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make release && ctest --test-dir build/release' + run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make build/release && ctest --test-dir build/release' BS2: # uses cmake + make if: github.repository_owner == 'upx' @@ -104,7 +104,7 @@ jobs: echo "UPX_CONFIG_DISABLE_C_STANDARD=ON" >> $GITHUB_ENV echo "UPX_CONFIG_DISABLE_CXX_STANDARD=ON" >> $GITHUB_ENV - name: 'Build and test Debug' - run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make debug && ctest --test-dir build/debug' + run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make build/debug && ctest --test-dir build/debug' - name: 'Build and test Release' if: success() || failure() # run this step even if the previous step failed - run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make release && ctest --test-dir build/release' + run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make build/release && ctest --test-dir build/release' diff --git a/src/check/dt_cxxlib.cpp b/src/check/dt_cxxlib.cpp index d5bc2edd..f5b16023 100644 --- a/src/check/dt_cxxlib.cpp +++ b/src/check/dt_cxxlib.cpp @@ -25,7 +25,7 @@ */ // lots of tests (and probably quite a number of redundant tests) -// modern compilers will optimize away quite a lot of this code +// modern compilers will optimize away much of this code #include "../conf.h"