diff --git a/.github/workflows/static-analyzer-clang-analyzer.yml b/.github/workflows/static-analyzer-clang-analyzer.yml index 4e3ea4e4..b98907aa 100644 --- a/.github/workflows/static-analyzer-clang-analyzer.yml +++ b/.github/workflows/static-analyzer-clang-analyzer.yml @@ -32,7 +32,7 @@ jobs: run: | # this seems to be needed when running in a container (beause of UID mismatch??) git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx . + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . git submodule update --init - name: 'Perform clang-analyzer scan-build Analysis Debug' run: 'make build/analyze/clang-analyzer/debug' diff --git a/.github/workflows/static-analyzer-clang-tidy.yml b/.github/workflows/static-analyzer-clang-tidy.yml index 58779f23..5c7c6bb6 100644 --- a/.github/workflows/static-analyzer-clang-tidy.yml +++ b/.github/workflows/static-analyzer-clang-tidy.yml @@ -30,7 +30,7 @@ jobs: run: | # this seems to be needed when running in a container (beause of UID mismatch??) git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx . + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . git submodule update --init - name: 'Perform clang-tidy Analysis Debug' run: 'make -k build/analyze/clang-tidy/debug' diff --git a/.github/workflows/weekly-ci-bs-by-hand.yml b/.github/workflows/weekly-ci-bs-by-hand.yml index d3c7eabe..68ed9d8c 100644 --- a/.github/workflows/weekly-ci-bs-by-hand.yml +++ b/.github/workflows/weekly-ci-bs-by-hand.yml @@ -39,7 +39,7 @@ jobs: adduser upx -u 2000 -D && cd /home/upx && chmod 00700 . && chown -R upx:upx . - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx "upx with space" + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" git -C "upx with space" submodule update --init - name: 'Build by-hand with /bin/sh' run: '/bin/sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' @@ -117,7 +117,7 @@ jobs: steps: - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx "upx with space" + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" git -C "upx with space" submodule update --init - name: 'Build by-hand with /bin/sh' run: 'top_srcdir="$PWD/upx with space" /bin/sh "./upx with space/misc/scripts/build_upx_by_hand.sh"' @@ -145,7 +145,7 @@ jobs: - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} shell: bash run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx "upx with space" + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" git -C "upx with space" submodule update --init - name: 'Build by-hand with bash' shell: bash diff --git a/.github/workflows/weekly-ci-bs-cmake-windows-ninja.yml b/.github/workflows/weekly-ci-bs-cmake-windows-ninja.yml index 3d510235..a04260a7 100644 --- a/.github/workflows/weekly-ci-bs-cmake-windows-ninja.yml +++ b/.github/workflows/weekly-ci-bs-cmake-windows-ninja.yml @@ -26,12 +26,14 @@ jobs: - { os: windows-2022, cc: cl, cxx: cl, vsversion: 2022, arch: amd64 } - { 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 (from MSVC) + # 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 +54,7 @@ jobs: shell: bash run: | command -v ninja >/dev/null || choco install -y --no-progress ninja - xtarget="windows-ninja-${{ matrix.cc }}-${{ matrix.vsversion }}-${{ matrix.arch}}" + xtarget="${{ matrix.os }}-ninja-${{ matrix.cc }}-${{ matrix.vsversion }}-${{ matrix.arch}}" echo "xtarget=$xtarget" >> $GITHUB_ENV - name: 'Build cmake Ninja Debug' shell: bash diff --git a/.github/workflows/weekly-ci-bs-misc.yml b/.github/workflows/weekly-ci-bs-misc.yml index df830fd9..ea46c465 100644 --- a/.github/workflows/weekly-ci-bs-misc.yml +++ b/.github/workflows/weekly-ci-bs-misc.yml @@ -1,24 +1,41 @@ # Copyright (C) Markus Franz Xaver Johannes Oberhumer -# BS BuildSystem: build misc +# BS BuildSystem: build with misc flags name: 'Weekly CI BS - Misc' on: - schedule: [cron: '40 1 * * 3'] # run weekly Wednesday 01:50 UTC + schedule: [cron: '50 1 * * 3'] # run weekly Wednesday 01:50 UTC workflow_dispatch: env: CMAKE_REQUIRED_QUIET: "OFF" CTEST_OUTPUT_ON_FAILURE: "ON" DEBIAN_FRONTEND: noninteractive + UPX_CMAKE_BUILD_FLAGS: --verbose jobs: - job-bs-misc: # uses cmake + make + BS0: + runs-on: ubuntu-latest + container: 'alpine:edge' + steps: + - name: 'Install packages' + run: | + apk update && apk upgrade && apk add bash git perl yq + git config --global --add safe.directory '*' + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . + - name: 'Misc checks' + run: | + cat ./.github/*.yml | yq > /dev/null + cat ./.github/*/*.yml | yq > /dev/null + bash ./misc/scripts/check_whitespace_git.sh + echo "All done." + + BS1: # uses cmake + make if: github.repository_owner == 'upx' strategy: fail-fast: false matrix: container: - - 'alpine:3.18' - - 'i386/alpine:3.18' + - 'alpine:edge' + - 'i386/alpine:edge' cc: - 'clang' - 'gcc' @@ -32,22 +49,62 @@ jobs: steps: - name: ${{ format('Install packages {0}', matrix.container) }} run: 'apk update && apk upgrade && apk add clang cmake g++ git make' - - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} + - name: ${{ format('Check out {0} source code', github.ref_name) }} run: | # this seems to be needed when running in a container (beause of UID mismatch??) git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx . + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . git submodule update --init - # set environment + # prepare environment xflags="-static ${{ matrix.cppflags }}" case ${{ matrix.cc }} in clang) CC="clang $xflags"; CXX="clang++ $xflags" ;; gcc) CC="gcc $xflags"; CXX="g++ $xflags" ;; - *) CC=false; CXX=false ;; + *) exit 99 ;; esac echo -e "CC=$CC\nCXX=$CXX" >> $GITHUB_ENV - - name: 'Build Debug' - run: 'make debug && ctest --test-dir build/debug' - - name: 'Build Release' + - name: 'Build and test Debug' + run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make debug && ctest --test-dir build/debug' + - name: 'Build and test Release' if: success() || failure() # run this step even if the previous step failed - run: 'make release && ctest --test-dir build/debug' + run: 'echo -e "CC=$CC;\nCXX=$CXX;" && make release && ctest --test-dir build/release' + + BS2: # uses cmake + make + if: github.repository_owner == 'upx' + strategy: + fail-fast: false + matrix: + container: + - 'alpine:edge' + cc: + - 'clang' + - 'gcc' + cxxflags: + - '-std=gnu++20' + - '-std=gnu++23' + runs-on: ubuntu-latest + container: ${{ matrix.container }} + steps: + - name: ${{ format('Install packages {0}', matrix.container) }} + run: 'apk update && apk upgrade && apk add clang cmake g++ git make' + - name: ${{ format('Check out {0} source code', github.ref_name) }} + run: | + # this seems to be needed when running in a container (beause of UID mismatch??) + git config --global --add safe.directory '*' + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . + git submodule update --init + # prepare environment + xflags="-static" + case ${{ matrix.cc }} in + clang) CC="clang $xflags"; CXX="clang++ $xflags ${{ matrix.cxxflags }}" ;; + gcc) CC="gcc $xflags"; CXX="g++ $xflags ${{ matrix.cxxflags }}" ;; + *) exit 99 ;; + esac + echo -e "CC=$CC\nCXX=$CXX" >> $GITHUB_ENV + 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' + - 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' diff --git a/.github/workflows/weekly-ci-cc-alpine-linux.yml b/.github/workflows/weekly-ci-cc-alpine-linux.yml index aeac5989..77760ffc 100644 --- a/.github/workflows/weekly-ci-cc-alpine-linux.yml +++ b/.github/workflows/weekly-ci-cc-alpine-linux.yml @@ -75,7 +75,7 @@ jobs: adduser upx -u 2000 -D && cd /home/upx && chmod 00700 . && chown -R upx:upx . - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx "upx with space" + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "upx with space" git -C "upx with space" submodule update --init # build with default C11 and C++17 diff --git a/.github/workflows/weekly-ci-cc-alpine-mingw.yml b/.github/workflows/weekly-ci-cc-alpine-mingw.yml index 0ac98181..81f27676 100644 --- a/.github/workflows/weekly-ci-cc-alpine-mingw.yml +++ b/.github/workflows/weekly-ci-cc-alpine-mingw.yml @@ -45,7 +45,7 @@ jobs: mkdir -p -v ~/.wine # this seems to be needed when running in a container (beause of UID mismatch??) git config --global --add safe.directory '*' - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx . + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . git submodule update --init - name: 'Build cmake extra/cross-windows-mingw32/debug' if: ${{ matrix.i686_mingw }} diff --git a/.github/workflows/weekly-ci-rt-checkers.yml b/.github/workflows/weekly-ci-rt-checkers.yml index 9108fc71..04dc5841 100644 --- a/.github/workflows/weekly-ci-rt-checkers.yml +++ b/.github/workflows/weekly-ci-rt-checkers.yml @@ -37,7 +37,7 @@ jobs: git config --global --add safe.directory '*' - name: ${{ format('Check out UPX {0} source code', github.ref_name) }} run: | - git clone --branch "$GITHUB_REF_NAME" --depth 1 https://github.com/upx/upx . + git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" . git submodule update --init git clone --depth=1 https://github.com/upx/upx-testsuite ../upx-testsuite