unbound/.github/workflows/analysis_ports.yml
2021-06-24 17:36:48 +02:00

379 lines
15 KiB
YAML

name: Analysis and Ports
on:
workflow_dispatch:
inputs:
start:
description: 'Start analysis and port workflow'
default: 'yes'
required: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# - name: GCC on Linux
# os: ubuntu-latest
# config: "--enable-debug --disable-flto"
# make_test: "yes"
# - name: Clang-analyzer
# os: ubuntu-latest
# config: "CC=clang --enable-debug --disable-flto --disable-static"
# make_test: "yes"
# clang_analysis: "yes"
# - name: libevent
# os: ubuntu-latest
# install_libevent: "yes"
# config: "CC=clang --enable-debug --disable-flto --with-libevent --disable-static"
# make_test: "yes"
# clang_analysis: "yes"
# - name: OS X
# os: macos-latest
# install_expat: "yes"
# config: "--enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl --with-libexpat=/usr/local/opt/expat"
# make_test: "yes"
# - name: Clang on OS X
# os: macos-latest
# install_expat: "yes"
# config: "CC=clang --enable-debug --disable-flto --with-ssl=/usr/local/opt/openssl --with-libexpat=/usr/local/opt/expat --disable-static"
# make_test: "yes"
# clang_analysis: "yes"
# - name: ubsan (gcc undefined behaviour sanitizer)
# os: ubuntu-latest
# config: 'CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=undefined -fno-sanitize-recover=all" --disable-flto --disable-static'
# make_test: "yes"
# - name: asan (gcc address sanitizer)
# os: ubuntu-latest
# config: 'CFLAGS="-DNDEBUG -g2 -O3 -fsanitize=address" --disable-flto --disable-static'
# make_test: "yes"
# - name: Apple iPhone on iOS, armv7
# os: macos-latest
# AUTOTOOLS_HOST: armv7-apple-ios
# OPENSSL_HOST: ios-cross
# IOS_SDK: iPhoneOS
# IOS_CPU: armv7s
# test_ios: "yes"
# config: "no"
# make: "no"
# - name: Apple iPhone on iOS, arm64
# os: macos-latest
# AUTOTOOLS_HOST: aarch64-apple-ios
# OPENSSL_HOST: ios64-cross
# IOS_SDK: iPhoneOS
# IOS_CPU: arm64
# test_ios: "yes"
# config: "no"
# make: "no"
# - name: Apple TV on iOS, arm64
# os: macos-latest
# AUTOTOOLS_HOST: aarch64-apple-ios
# OPENSSL_HOST: ios64-cross
# IOS_SDK: AppleTVOS
# IOS_CPU: arm64
# test_ios: "yes"
# config: "no"
# make: "no"
# - name: Apple Watch on iOS, armv7
# os: macos-latest
# AUTOTOOLS_HOST: armv7-apple-ios
# OPENSSL_HOST: ios-cross
# IOS_SDK: WatchOS
# IOS_CPU: armv7k
# test_ios: "yes"
# config: "no"
# make: "no"
# - name: iPhoneSimulator on OS X, i386
# os: macos-latest
# AUTOTOOLS_HOST: i386-apple-ios
# OPENSSL_HOST: iphoneos-cross
# IOS_SDK: iPhoneSimulator
# IOS_CPU: i386
# test_ios: "yes"
# config: "no"
# make: "no"
# - name: iPhoneSimulator on OS X, x86_64
# os: macos-latest
# AUTOTOOLS_HOST: x86_64-apple-ios
# OPENSSL_HOST: iphoneos-cross
# IOS_SDK: iPhoneSimulator
# IOS_CPU: x86_64
# test_ios: "yes"
# config: "no"
# make: "no"
# - name: AppleTVSimulator on OS X, x86_64
# os: macos-latest
# AUTOTOOLS_HOST: x86_64-apple-ios
# OPENSSL_HOST: iphoneos-cross
# IOS_SDK: AppleTVSimulator
# IOS_CPU: x86_64
# test_ios: "yes"
# config: "no"
# make: "no"
# - name: WatchSimulator on OS X, i386
# os: macos-latest
# AUTOTOOLS_HOST: i386-apple-ios
# OPENSSL_HOST: iphoneos-cross
# IOS_SDK: WatchSimulator
# IOS_CPU: i386
# test_ios: "yes"
# config: "no"
# make: "no"
# - name: Android armv7a
# os: ubuntu-latest
# AUTOTOOLS_HOST: armv7a-linux-androidabi
# OPENSSL_HOST: android-arm
# ANDROID_CPU: armv7a
# ANDROID_API: 23
# test_android: "yes"
# config: "no"
# make: "no"
# - name: Android aarch64
# os: ubuntu-latest
# AUTOTOOLS_HOST: aarch64-linux-android
# OPENSSL_HOST: android-arm64
# ANDROID_CPU: aarch64
# ANDROID_API: 23
# test_android: "yes"
# config: "no"
# make: "no"
# - name: Android x86
# os: ubuntu-latest
# AUTOTOOLS_HOST: i686-linux-android
# OPENSSL_HOST: android-x86
# ANDROID_CPU: x86
# ANDROID_API: 23
# test_android: "yes"
# config: "no"
# make: "no"
# - name: Android x86_64
# os: ubuntu-latest
# AUTOTOOLS_HOST: x86_64-linux-android
# OPENSSL_HOST: android-x86_64
# ANDROID_CPU: x86_64
# ANDROID_API: 23
# test_android: "yes"
# config: "no"
# make: "no"
- name: Windows
os: windows-latest
test_windows: "yes"
config: "no"
make: "no"
steps:
- uses: actions/checkout@v2
with:
submodules: false
- name: test_windows
if: ${{ matrix.test_windows == 'yes' }}
shell: bash
run: |
echo 'c:'
ls -l 'c:\' || echo nevermind
echo 'Program Files'
ls -l 'c:\Program Files' || echo nevermind
echo 'Program Files (x86)'
ls -l 'c:\Program Files (x86)' || echo nevermind
echo '/c/Program Files/OpenSSL'
ls -l '/c/Program Files/OpenSSL' || echo nevermind
echo '/'
ls -l '/' || echo nevermind
echo '/mingw64'
ls -l '/mingw64' || echo nevermind
echo '/mingw64/bin'
ls -l '/mingw64/bin' || echo nevermind
echo '/c/Users'
ls -l '/c/Users' || echo nevermind
echo '/mingw64/ssl'
ls -l '/mingw64/ssl' || echo nevermind
echo '/c/ProgramData/Chocolatey'
ls -l '/c/ProgramData/Chocolatey' || echo nevermind
echo '/c/ProgramData/Chocolatey/tools'
ls -l '/c/ProgramData/Chocolatey/tools' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib'
ls -l '/c/ProgramData/Chocolatey/lib' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/OpenSSL.Light'
ls -l '/c/ProgramData/Chocolatey/lib/OpenSSL.Light' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/OpenSSL.Light/tools'
ls -l '/c/ProgramData/Chocolatey/lib/OpenSSL.Light/tools' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/mingw'
ls -l '/c/ProgramData/Chocolatey/lib/mingw' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/mingw/tools'
ls -l '/c/ProgramData/Chocolatey/lib/mingw/tools' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/mingw/tools/install'
ls -l '/c/ProgramData/Chocolatey/lib/mingw/tools/install' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64'
ls -l '/c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin'
ls -l '/c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/include'
ls -l '/c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/include' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/rtools'
ls -l '/c/ProgramData/Chocolatey/lib/rtools' || echo nevermind
echo '/c/ProgramData/Chocolatey/lib/rtools/tools'
ls -l '/c/ProgramData/Chocolatey/lib/rtools/tools' || echo nevermind
echo '/c/Users/Default'
ls -l '/c/Users/Default' || echo nevermind
echo '/usr'
ls -l '/usr' || echo nevermind
echo '/usr/lib'
ls -l '/usr/lib' || echo nevermind
echo '/usr/share'
ls -l '/usr/share' || echo nevermind
echo '/c/Strawberry/perl'
ls -l '/c/Strawberry/perl' || echo nevermind
echo '/c/Strawberry/perl/bin'
ls -l '/c/Strawberry/perl/bin' || echo nevermind
echo '/c/Strawberry/perl/lib'
ls -l '/c/Strawberry/perl/lib' || echo nevermind
echo '/c/Strawberry/perl/site'
ls -l '/c/Strawberry/perl/site' || echo nevermind
echo '/c/Strawberry/perl/site/lib'
ls -l '/c/Strawberry/perl/site/lib' || echo nevermind
echo '/usr/lib/perl5'
ls -l '/usr/lib/perl5' || echo nevermind
echo '/usr/share/perl5'
ls -l '/usr/share/perl5' || echo nevermind
echo '/usr/share/perl5/vendor_perl'
ls -l '/usr/share/perl5/vendor_perl' || echo nevermind
echo '/usr/share/perl5/vendor_perl/Pod'
ls -l '/usr/share/perl5/vendor_perl/Pod' || echo nevermind
echo which perl
which perl
echo PATH="$PATH"
export unboundpath=`pwd`
echo unboundpath=${unboundpath}
cd ..
export prepath=`pwd`
echo prepath=${prepath}
echo "curl cpanm"
curl -L https://cpanmin.us/ -o cpanm
perl cpanm POD::Usage
mkdir openssl
echo "curl openssl"
curl -L -k -s -S -o openssl-1.1.1j.tar.gz https://www.openssl.org/source/openssl-1.1.1j.tar.gz
tar xzf openssl-1.1.1j.tar.gz
cd openssl-1.1.1j
#export PERL5LIB="/c/Strawberry/perl/lib"
#export PERL5LIB="/usr/share/perl5/lib:/usr/share/perl5/vendor:/usr/share/perl5/site"
#echo PERL5LIB="$PERL5LIB"
#echo "cpan"
#cpan POD::Usage
#echo "perl MCPAN"
#perl -MCPAN -e "CPAN::Shell->force(qw(install POD::Usage));"
./Configure no-shared no-asm -DOPENSSL_NO_CAPIENG mingw64 --prefix="/$prepath/openssl"
make
make install_sw
cd ..
cd unbound
./configure --enable-debug --enable-static-exe --disable-flto --with-ssl=/$prepath/openssl
make
make test
- name: test_android
if: ${{ matrix.test_android == 'yes' }}
env:
AUTOTOOLS_HOST: ${{ matrix.AUTOTOOLS_HOST }}
OPENSSL_HOST: ${{ matrix.OPENSSL_HOST }}
ANDROID_API: ${{ matrix.ANDROID_API }}
ANDROID_CPU: ${{ matrix.ANDROID_CPU }}
run: |
#(already installed) ./contrib/android/install_tools.sh
export ANDROID_PREFIX="$HOME/android$ANDROID_API-$ANDROID_CPU"
echo ANDROID_PREFIX=${ANDROID_PREFIX}
export ANDROID_SDK_ROOT="$HOME/android-sdk"
echo ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}
export ANDROID_NDK_ROOT="$HOME/android-ndk"
echo ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT}
export AUTOTOOLS_BUILD="$(./config.guess)"
echo AUTOTOOLS_BUILD=${AUTOTOOLS_BUILD}
export PKG_CONFIG_PATH="$ANDROID_PREFIX/lib/pkgconfig"
echo PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
export CONFIG_OPTS="--build=$AUTOTOOLS_BUILD --host=$AUTOTOOLS_HOST --prefix=$ANDROID_PREFIX --with-ssl=$ANDROID_PREFIX --disable-gost --with-libexpat=$ANDROID_PREFIX"
echo CONFIG_OPTS=${CONFIG_OPTS}
echo "::group::install_ndk"
echo "./contrib/android/install_ndk.sh"
./contrib/android/install_ndk.sh
echo "::endgroup::"
echo "::group::setenv_android.sh"
echo "./contrib/android/setenv_android.sh"
source ./contrib/android/setenv_android.sh
echo "::endgroup::"
echo "::group::install_openssl"
echo "./contrib/android/install_openssl.sh"
./contrib/android/install_openssl.sh
echo "::endgroup::"
echo "::group::install_expat"
echo "./contrib/android/install_expat.sh"
./contrib/android/install_expat.sh
echo "::endgroup::"
echo "::group::configure"
echo "./configure ${CONFIG_OPTS}"
./configure ${CONFIG_OPTS}
echo "::endgroup::"
echo "::group::make"
# make is here to preserve environment variables
make
echo "::endgroup::"
echo "::group::make install"
make install
echo "::endgroup::"
- name: test ios
if: ${{ matrix.test_ios == 'yes' }}
env:
AUTOTOOLS_HOST: ${{ matrix.AUTOTOOLS_HOST }}
OPENSSL_HOST: ${{ matrix.OPENSSL_HOST }}
IOS_SDK: ${{ matrix.IOS_SDK }}
IOS_CPU: ${{ matrix.IOS_CPU }}
run: |
#(already installed) ./contrib/ios/install_tools.sh
export AUTOTOOLS_BUILD="$(./config.guess)"
echo AUTOTOOLS_BUILD=${AUTOTOOLS_BUILD}
export IOS_PREFIX="$HOME/$IOS_SDK-$IOS_CPU"
echo IOS_PREFIX=${IOS_PREFIX}
export PKG_CONFIG_PATH="$IOS_PREFIX/lib/pkgconfig"
echo PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
export CONFIG_OPTS="--build=$AUTOTOOLS_BUILD --host=$AUTOTOOLS_HOST --prefix=$IOS_PREFIX --with-ssl=$IOS_PREFIX --disable-gost --with-libexpat=$IOS_PREFIX"
echo CONFIG_OPTS=${CONFIG_OPTS}
echo "::group::setenv_ios.sh"
echo "./contrib/ios/setenv_ios.sh"
source ./contrib/ios/setenv_ios.sh
echo "::endgroup::"
echo "::group::install_openssl"
echo "./contrib/ios/install_openssl.sh"
./contrib/ios/install_openssl.sh
echo "::endgroup::"
echo "::group::install_expat"
echo "./contrib/ios/install_expat.sh"
./contrib/ios/install_expat.sh
echo "::endgroup::"
echo "::group::configure"
echo "./configure ${CONFIG_OPTS}"
./configure ${CONFIG_OPTS}
echo "::endgroup::"
echo "::group::make"
# make is here to preserve environment variables
make
echo "::endgroup::"
echo "::group::make install"
make install
echo "::endgroup::"
- name: install libevent
if: ${{ matrix.install_libevent == 'yes' }}
run: sudo apt-get install libevent-dev
- name: install expat
if: ${{ matrix.install_expat == 'yes' }}
run: brew install expat
- name: configure
if: ${{ matrix.config != 'no' }}
run: ./configure ${{ matrix.config }}
- name: make
if: ${{ matrix.make != 'no' }}
run: make
- name: make test
if: ${{ matrix.make_test == 'yes' }}
run: make test
- name: clang-analysis
if: ${{ matrix.clang_analysis == 'yes' }}
run: (cd testdata/clang-analysis.tdir; bash clang-analysis.test)