mirror of https://github.com/upx/upx.git
CI: cleanups
This commit is contained in:
parent
1ff0d137ab
commit
a5206eb696
|
@ -11,6 +11,8 @@ on: [push, workflow_dispatch]
|
|||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
UPX_CMAKE_BUILD_FLAGS: --verbose
|
||||
# 2023-06-11
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.3395+1e7dcaa3a
|
||||
|
||||
jobs:
|
||||
job-rebuild-and-verify-stubs:
|
||||
|
@ -366,28 +368,27 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# only build a few targets => more targets are tested in the Weekly CI
|
||||
- { zig_target: aarch64-linux-musl }
|
||||
- { zig_target: aarch64-linux-musl, zig_pic: -fPIE }
|
||||
# { zig_target: aarch64-linux-musl, zig_pic: -fPIE }
|
||||
- { zig_target: aarch64-macos.11-none }
|
||||
- { zig_target: aarch64-macos.12-none }
|
||||
- { zig_target: aarch64-macos.13-none }
|
||||
# { zig_target: aarch64-macos.12-none }
|
||||
# { zig_target: aarch64-macos.13-none }
|
||||
- { zig_target: aarch64-windows-gnu }
|
||||
- { zig_target: i386-linux-musl }
|
||||
# { zig_target: i386-linux-musl }
|
||||
- { zig_target: i386-windows-gnu }
|
||||
- { zig_target: mips-linux-musl }
|
||||
- { zig_target: mipsel-linux-musl }
|
||||
- { zig_target: powerpc-linux-musl }
|
||||
- { zig_target: powerpc64-linux-musl }
|
||||
- { zig_target: powerpc64le-linux-musl }
|
||||
# { zig_target: mips-linux-musl }
|
||||
# { zig_target: mipsel-linux-musl }
|
||||
# { zig_target: powerpc-linux-musl }
|
||||
# { zig_target: powerpc64-linux-musl }
|
||||
# { zig_target: powerpc64le-linux-musl }
|
||||
- { zig_target: x86_64-linux-musl }
|
||||
- { zig_target: x86_64-linux-musl, zig_pic: -fPIE }
|
||||
# { zig_target: x86_64-linux-musl, zig_pic: -fPIE }
|
||||
- { zig_target: x86_64-macos.11-none }
|
||||
- { zig_target: x86_64-macos.12-none }
|
||||
- { zig_target: x86_64-macos.13-none }
|
||||
# { zig_target: x86_64-macos.12-none }
|
||||
# { zig_target: x86_64-macos.13-none }
|
||||
- { zig_target: x86_64-windows-gnu }
|
||||
env:
|
||||
# 2023-06-11
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.3395+1e7dcaa3a
|
||||
# for zig-cc wrapper scripts (see below):
|
||||
ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING
|
||||
ZIG_FLAGS: ${{ matrix.zig_flags }}
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
|
||||
name: 'GitHub - Close inactive issues'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '40 3 * * 3'
|
||||
schedule: [cron: '50 3 * * 3'] # run weekly Wednesday 03:50 UTC
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
close-issues:
|
|
@ -1,12 +1,11 @@
|
|||
name: 'Static Analyzer - clang scan-build'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '40 4 * * 3'
|
||||
schedule: [cron: '20 5 * * 3'] # run weekly Wednesday 05:20 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
job-analyze-clang:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: {container: ['alpine:3.16','alpine:3.17','alpine:3.18','alpine:edge','i386/alpine:edge']}
|
|
@ -1,29 +1,21 @@
|
|||
name: 'Static Analyzer - CodeQL'
|
||||
|
||||
on:
|
||||
# push:
|
||||
# branches: [ 'devel', 'devel4', 'devel5', 'master' ]
|
||||
# pull_request:
|
||||
# # The branches below must be a subset of the branches above
|
||||
# branches: [ 'devel', 'devel4', 'devel5' ]
|
||||
schedule:
|
||||
- cron: '20 4 * * 3'
|
||||
schedule: [cron: '40 5 * * 3'] # run weekly Wednesday 05:40 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
job-analyze-codeql:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'cpp' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
|
@ -1,3 +1,7 @@
|
|||
# test minimal number of packages required for building UPX under Alpine Linux
|
||||
# clang: apk add clang cmake make
|
||||
# gcc: apk add cmake g++ make
|
||||
|
||||
name: 'Test - Minimal Alpine build'
|
||||
on: [workflow_dispatch]
|
||||
jobs:
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# minimal GitHub CI building UPX with clang and gcc in an Alpine Linux container
|
||||
# build under various Alpine Linux versions with clang and gcc
|
||||
|
||||
name: 'Weekly CI - Alpine Linux'
|
||||
|
||||
name: 'CI - Minimal CI with Alpine Linux'
|
||||
on:
|
||||
schedule: [cron: '50 3 * * 3']
|
||||
schedule: [cron: '10 4 * * 3'] # run weekly Wednesday 04:10 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
job-alpine-cmake:
|
||||
strategy:
|
||||
|
@ -13,7 +15,7 @@ jobs:
|
|||
name: ${{ format('container {0}', matrix.container) }}
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}
|
||||
env: { VERBOSE: 1 }
|
||||
env: { UPX_CMAKE_CONFIG_FLAGS: '-DCMAKE_VERBOSE_MAKEFILE=ON' }
|
||||
steps:
|
||||
- name: ${{ format('Install packages {0}', matrix.container) }}
|
||||
run: 'apk update && apk upgrade && apk add clang cmake g++ git make'
|
||||
|
@ -23,7 +25,7 @@ jobs:
|
|||
git -C upx submodule update --init
|
||||
x="$(apk list -I "$(apk info -Wq "$(which clang)")")"; echo "clang_package=${x%% *}" >> $GITHUB_ENV
|
||||
x="$(apk list -I "$(apk info -Wq "$(which gcc)")")"; echo "gcc_package=${x%% *}" >> $GITHUB_ENV
|
||||
echo "artifact_name=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-minimal-ci-${{ matrix.container }}" | sed 's/[^=0-9a-zA-Z_.-]/-/g' >> $GITHUB_ENV
|
||||
echo "artifact_name=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-alpine-${{ matrix.container }}" | sed 's/[^=0-9a-zA-Z_.-]/-/g' >> $GITHUB_ENV
|
||||
- name: ${{ format('Build clang Release with {0}', env.clang_package) }}
|
||||
run: 'make -C upx UPX_XTARGET=clang-static CC="clang -static" CXX="clang++ -static"'
|
||||
- name: ${{ format('Build clang Debug with {0}', env.clang_package) }}
|
|
@ -0,0 +1,31 @@
|
|||
# build with "cmake -G Xcode"
|
||||
|
||||
name: 'Weekly CI - macOS cmake Xcode'
|
||||
|
||||
on:
|
||||
schedule: [cron: '20 4 * * 3'] # run weekly Wednesday 04:20 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
job-macos-cmake-xcode:
|
||||
name: ${{ format('{0} cmake Xcode', matrix.os) }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { os: macos-11, run_test: true }
|
||||
- { os: macos-12, run_test: true }
|
||||
- { os: macos-13, run_test: false } # TODO: enable once UPX fully works on macos-13
|
||||
steps:
|
||||
- name: 'Check out code'
|
||||
uses: actions/checkout@v3
|
||||
with: { submodules: true }
|
||||
- { name: 'Config cmake Xcode', run: 'cmake -S . -B build/xcode -G Xcode' }
|
||||
- { name: 'Build cmake Xcode Debug', run: 'cmake --build build/xcode --config Debug' }
|
||||
- { name: 'Build cmake Xcode Release', run: 'cmake --build build/xcode --config Release' }
|
||||
- name: 'Run basic tests'
|
||||
if: ${{ matrix.run_test }}
|
||||
run: |
|
||||
ctest --test-dir build/xcode -C Debug
|
||||
ctest --test-dir build/xcode -C Release
|
|
@ -0,0 +1,121 @@
|
|||
# build with "zig cc"; see https://ziglang.org/download/
|
||||
|
||||
name: 'Weekly CI - zigcc'
|
||||
|
||||
on:
|
||||
schedule: [cron: '30 4 * * 3'] # run weekly Wednesday 04:30 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# 2023-06-11
|
||||
ZIG_DIST_VERSION: 0.11.0-dev.3395+1e7dcaa3a
|
||||
|
||||
jobs:
|
||||
job-linux-zigcc:
|
||||
name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }}
|
||||
runs-on: ubuntu-latest
|
||||
container: 'alpine:3.18' # older versions such as alpine:3.12 also work; no-container also works
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { zig_target: aarch64-linux-musl }
|
||||
- { zig_target: aarch64-linux-musl, zig_pic: -fPIE }
|
||||
- { zig_target: aarch64-macos.11-none }
|
||||
- { zig_target: aarch64-macos.12-none }
|
||||
- { zig_target: aarch64-macos.13-none }
|
||||
- { zig_target: aarch64-windows-gnu }
|
||||
- { zig_target: i386-linux-musl }
|
||||
- { zig_target: i386-windows-gnu }
|
||||
- { zig_target: mips-linux-musl }
|
||||
- { zig_target: mipsel-linux-musl }
|
||||
- { zig_target: powerpc-linux-musl }
|
||||
- { zig_target: powerpc64-linux-musl }
|
||||
- { zig_target: powerpc64le-linux-musl }
|
||||
- { zig_target: x86_64-linux-musl }
|
||||
- { zig_target: x86_64-linux-musl, zig_pic: -fPIE }
|
||||
- { zig_target: x86_64-macos.11-none }
|
||||
- { zig_target: x86_64-macos.12-none }
|
||||
- { zig_target: x86_64-macos.13-none }
|
||||
- { zig_target: x86_64-windows-gnu }
|
||||
env:
|
||||
# for zig-cc wrapper scripts (see below):
|
||||
ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING
|
||||
ZIG_FLAGS: ${{ matrix.zig_flags }}
|
||||
ZIG_PIC: ${{ matrix.zig_pic }}
|
||||
ZIG_TARGET: ${{ matrix.zig_target }}
|
||||
steps:
|
||||
- name: 'Install Alpine Linux container packages'
|
||||
if: ${{ job.container }}
|
||||
shell: sh
|
||||
run: |
|
||||
apk update && apk upgrade && apk add bash cmake file git make tar xz
|
||||
# set PATH like in Ubuntu
|
||||
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
|
||||
# this seems to be needed when running in a container (beause of UID mismatch??)
|
||||
git config --global --add safe.directory '*'
|
||||
- name: 'Check out code'
|
||||
uses: actions/checkout@v3
|
||||
with: { submodules: true }
|
||||
- name: ${{ format('Install Zig {0}', env.ZIG_DIST_VERSION) }}
|
||||
shell: bash
|
||||
run: |
|
||||
# GitHub Actions magic: set "UPX_GITREV_SHORT" environment value for use in steps below
|
||||
rev=$(git rev-parse --short=7 HEAD)
|
||||
echo "UPX_GITREV_SHORT=$rev" >> $GITHUB_ENV
|
||||
# update ZIG_TARGET (i386 => x86)
|
||||
ZIG_TARGET=${ZIG_TARGET/i386-/x86-}
|
||||
echo "ZIG_TARGET=$ZIG_TARGET" >> $GITHUB_ENV
|
||||
# install zig; note that ~/.local/bin is included in the default $PATH on Ubuntu
|
||||
mkdir -p -v ~/.local/bin
|
||||
cd ~/.local/bin
|
||||
ZIG_DIST_NAME=zig-linux-x86_64-${ZIG_DIST_VERSION}
|
||||
wget -q https://ziglang.org/builds/${ZIG_DIST_NAME}.tar.xz
|
||||
ls -l ${ZIG_DIST_NAME}.tar.xz
|
||||
tar -xoJf ${ZIG_DIST_NAME}.tar.xz
|
||||
rm ${ZIG_DIST_NAME}.tar.xz
|
||||
ln -s -v ${ZIG_DIST_NAME}/zig zig
|
||||
#echo "PATH=$PATH" && which zig
|
||||
echo -n 'zig version: '; zig version
|
||||
# create wrapper scripts (needed for CMake)
|
||||
echo -e '#!/bin/sh\nexec zig ar "$@"' > zig-ar
|
||||
echo -e '#!/bin/sh\nexec zig cc -target $ZIG_TARGET $ZIG_PIC $ZIG_FLAGS $ZIG_CPPFLAGS $ZIG_CFLAGS "$@"' > zig-cc
|
||||
echo -e '#!/bin/sh\nexec zig c++ -target $ZIG_TARGET $ZIG_PIC $ZIG_FLAGS $ZIG_CPPFLAGS $ZIG_CXXFLAGS "$@"' > zig-cxx
|
||||
echo -e '#!/bin/sh\nexec zig ranlib "$@"' > zig-ranlib
|
||||
chmod +x zig-ar zig-cc zig-cxx zig-ranlib
|
||||
ls -la; head zig-ar zig-cc zig-cxx zig-ranlib
|
||||
- name: ${{ format('Build Release with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }}
|
||||
run: |
|
||||
mkdir -p build/zig/${ZIG_TARGET}${ZIG_PIC}/release
|
||||
cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release
|
||||
cmake ../../../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_AR=$HOME/.local/bin/zig-ar -DCMAKE_C_COMPILER=zig-cc -DCMAKE_CXX_COMPILER=zig-cxx -DCMAKE_RANLIB=$HOME/.local/bin/zig-ranlib $EXTRA_CMAKE_CONFIG_FLAGS_RELEASE
|
||||
cmake --build . --config Release --parallel --verbose
|
||||
file ./upx*
|
||||
- name: ${{ format('Build Debug with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }}
|
||||
run: |
|
||||
mkdir -p build/zig/${ZIG_TARGET}${ZIG_PIC}/debug
|
||||
cd build/zig/${ZIG_TARGET}${ZIG_PIC}/debug
|
||||
cmake ../../../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_AR=$HOME/.local/bin/zig-ar -DCMAKE_C_COMPILER=zig-cc -DCMAKE_CXX_COMPILER=zig-cxx -DCMAKE_RANLIB=$HOME/.local/bin/zig-ranlib $EXTRA_CMAKE_CONFIG_FLAGS_DEBUG
|
||||
cmake --build . --config Debug --parallel --verbose
|
||||
file ./upx*
|
||||
- name: ${{ format('Make artifact from upx-{0}-{1}', github.ref_name, env.UPX_GITREV_SHORT) }}
|
||||
shell: bash
|
||||
run: |
|
||||
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-weekly-ci-zigcc-${{ matrix.zig_target }}${ZIG_PIC}
|
||||
mkdir -p "tmp/artifact/$N"
|
||||
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
|
||||
(cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
||||
# 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) }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.artifact_name }}
|
||||
path: tmp/artifact
|
||||
- name: 'Run install tests'
|
||||
if: ${{ contains(matrix.zig_target, '-linux-') }}
|
||||
run: |
|
||||
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-cmake cmake --install .)
|
||||
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-make make install)
|
||||
|
||||
# vim:set ts=2 sw=2 et:
|
|
@ -1,6 +1,7 @@
|
|||
/.hg*
|
||||
/.vscode*
|
||||
/Makevars.global*
|
||||
/Testing*
|
||||
/build*
|
||||
/maint*
|
||||
/vendor*
|
||||
|
|
Loading…
Reference in New Issue