diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000..3548a7e9 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,27 @@ +env: + CIRRUS_CLONE_DEPTH: 1 + ARCH: amd64 + +FreeBSD_task: + matrix: + env: + BS: autotools + env: + BS: cmake + matrix: + freebsd_instance: + image_family: freebsd-13-2 + freebsd_instance: + image_family: freebsd-12-4 + prepare_script: + - ./ci/cirrus_ci/freebsd.sh + autogen_script: + - ./ci/ci.sh -a autogen + configure_script: + - ./ci/ci.sh -a configure + build_script: + - ./ci/ci.sh -a build + test_script: + - ./ci/ci.sh -a test + install_script: + - ./ci/ci.sh -a install diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index cd8e2f08..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,163 +0,0 @@ -# SPDX-License-Identifier: 0BSD - -############################################################################# -# -# Author: Jia Tan -# -############################################################################# - -name: CI - -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows running workflow manually - workflow_dispatch: - -jobs: - POSIX: - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - build_system: [autotools, cmake] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4.1.6 - - ######################## - # Install Dependencies # - ######################## - - # Install Autotools on Linux - - name: Install Dependencies - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} - run: | - sudo apt-get update - sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools valgrind - - # Install Autotools on Mac - - name: Install Dependencies - if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'autotools' }} - run: brew install autoconf automake libtool po4a doxygen - - # Install CMake on Linux - - name: Install Dependencies - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'cmake' }} - run: | - sudo apt-get update - sudo apt-get install -y build-essential cmake musl-tools - - # Install CMake on Mac - - name: Install Dependencies - if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'cmake' }} - run: brew install cmake - - ################## - # Build and Test # - ################## - - # -b specifies the build system to use. - # -p specifies the phase (build or test) to help narrow down an error - # if one occurs. - # - # The first two builds/tests are only run on Autotools Linux and - # affect the CFLAGS. Resetting the CFLAGS requires clearing the - # config cache between runs, so the tests that require CFLAGS are - # done first. - - name: Build 32-bit - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} - run: ./build-aux/ci_build.bash -b autotools -p build -m "gcc -m32" - - name: Test 32-bit - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} - run: | - ./build-aux/ci_build.bash -b autotools -p test -m "gcc -m32" -n 32_bit - cd ../xz_build && make distclean - - # The sandbox must be disabled because it will prevent access to - # the /proc/ filesystem on Linux, which is used by the sanitizer's - # instrumentation. - - name: Build with -fsanitize=address,undefined - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} - run: ./build-aux/ci_build.bash -b autotools -p build -f "-fsanitize=address,undefined" -d sandbox - - name: Test with -fsanitize=address,undefined - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} - run: | - export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 - ./build-aux/ci_build.bash -b autotools -p test -f "-fsanitize=address,undefined" -d sandbox - cd ../xz_build && make distclean - - - name: Build with Valgrind - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} - run: ./build-aux/ci_build.bash -b autotools -p build -d sandbox - - name: Test with Valgrind - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} - run: | - ./build-aux/ci_build.bash -b autotools -p test -d sandbox -w "valgrind --quiet --trace-children=yes --trace-children-skip-by-arg=ls,cp,sed,grep,bash,sh --exit-on-first-error=yes --error-exitcode=1" - cd ../xz_build && make distclean - - - name: Build with musl libc - if: ${{ matrix.os == 'ubuntu-latest'}} - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc" - - name: Test with musl libc - if: ${{ matrix.os == 'ubuntu-latest'}} - run: | - ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc" - - name: Clean up musl libc run - if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} - run: cd ../xz_build && make distclean - - - name: Build with full features - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build - - name: Test with full features - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -n full_features - - - name: Build without encoders - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d encoders,shared -p build - - name: Test without encoders - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders - - - name: Build without decoders - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d decoders,shared -p build - - name: Test without decoders - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders - - - name: Build without threads - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d threads,shared -p build - - name: Test without threads - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads - - - name: Build without BCJ filters - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d bcj,shared,nls -p build - - name: Test without BCJ filters - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d bcj,shared,nls -p test -n no_bcj - - - name: Build without Delta filters - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d delta,shared,nls -p build - - name: Test without Delta filters - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d delta,shared,nls -p test -n no_delta - - - name: Build without sha256 check - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p build - - name: Test without sha256 check - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p test -n no_sha256 - - - name: Build without crc64 check - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p build - - name: Test without crc64 check - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p test -n no_crc64 - - - name: Build small - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d small -p build - - name: Test small - run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d small -p test -n small - - # Attempt to upload the test logs as artifacts if any step has failed - - uses: actions/upload-artifact@v4.3.3 - if: ${{ failure() }} - with: - name: ${{ matrix.os }} ${{ matrix.build_system }} Test Logs - path: build-aux/artifacts diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml deleted file mode 100644 index 2eb7805f..00000000 --- a/.github/workflows/freebsd.yml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-License-Identifier: 0BSD - -name: FreeBSD - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - workflow_dispatch: - -jobs: - FreeBSD-test: - runs-on: ubuntu-latest - name: Test xz on FreeBSD - steps: - - uses: actions/checkout@v4.1.6 - - name: Test in FreeBSD - id: test - uses: vmactions/FreeBSD-vm@f8be330398166d1eb0601f01353839d4052367b2 #v1.0.7 - with: - usesh: true - prepare: | - pkg install -y autoconf automake gmake gettext-tools gtar libtool m4 po4a - run: | - set -e - export LC_ALL=C LANG=C - uname -a - ./autogen.sh - ./configure --enable-werror - make - make check VERBOSE=1 diff --git a/.github/workflows/la-ci.yml b/.github/workflows/la-ci.yml new file mode 100644 index 00000000..b0033200 --- /dev/null +++ b/.github/workflows/la-ci.yml @@ -0,0 +1,93 @@ +name: CI + +on: [push, pull_request] + +jobs: + MacOS: + runs-on: macos-latest + strategy: + matrix: + bs: [autotools, cmake] + steps: + - uses: actions/checkout@master + - name: Install dependencies + run: ./ci/github_actions/macos.sh + - name: Autogen + run: ./ci/ci.sh -a autogen + env: + BS: ${{ matrix.bs }} + - name: Configure + run: ./ci/ci.sh -a configure + env: + BS: ${{ matrix.bs }} + - name: Build + run: ./ci/ci.sh -a build + env: + BS: ${{ matrix.bs }} + - name: Test + run: ./ci/ci.sh -a test + env: + BS: ${{ matrix.bs }} + SKIP_OPEN_FD_ERR_TEST: 1 + - name: Install + run: ./ci/ci.sh -a install + env: + BS: ${{ matrix.bs }} + + Ubuntu: + runs-on: ubuntu-latest + strategy: + matrix: + bs: [autotools, cmake] + steps: + - uses: actions/checkout@master + - name: Install dependencies + run: sudo apt-get install -y build-essential cmake debhelper autoconf automake libtool gettext po4a doxygen + - name: Autogen + run: ./ci/ci.sh -a autogen + env: + BS: ${{ matrix.bs }} + - name: Configure + run: ./ci/ci.sh -a configure + env: + BS: ${{ matrix.bs }} + - name: Build + run: ./ci/ci.sh -a build + env: + BS: ${{ matrix.bs }} + - name: Test + run: ./ci/ci.sh -a test + env: + BS: ${{ matrix.bs }} + - name: Install + run: ./ci/ci.sh -a install + env: + BS: ${{ matrix.bs }} + + Windows: + runs-on: windows-latest + strategy: + matrix: + be: [mingw-gcc, msvc] + steps: + - uses: actions/checkout@master + - name: Configure + run: ./ci/github_actions/ci.cmd configure + shell: cmd + env: + BE: ${{ matrix.be }} + - name: Build + run: ./ci/github_actions/ci.cmd build + shell: cmd + env: + BE: ${{ matrix.be }} + - name: Test + run: ./ci/github_actions/ci.cmd test + shell: cmd + env: + BE: ${{ matrix.be }} + - name: Install + run: ./ci/github_actions/ci.cmd install + shell: cmd + env: + BE: ${{ matrix.be }} diff --git a/.github/workflows/netbsd.yml b/.github/workflows/netbsd.yml deleted file mode 100644 index 75f05186..00000000 --- a/.github/workflows/netbsd.yml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-License-Identifier: 0BSD - -name: NetBSD - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - workflow_dispatch: - -jobs: - NetBSD-test: - runs-on: ubuntu-latest - name: Test xz on NetBSD - steps: - - uses: actions/checkout@v4.1.6 - - name: Test in NetBSD - id: test - uses: vmactions/NetBSD-vm@da9ed4d7cd0fb64f330e2342ac5c77ba529b6a11 #v1.0.7 - with: - usesh: true - prepare: | - /usr/sbin/pkg_add -v autoconf automake gmake gettext-tools gtar-base libtool-base m4 po4a - run: | - set -e - export LC_ALL=C LANG=C - uname -a - ./autogen.sh - ./configure --enable-werror - make - make check VERBOSE=1 diff --git a/.github/workflows/openbsd.yml b/.github/workflows/openbsd.yml deleted file mode 100644 index f0312530..00000000 --- a/.github/workflows/openbsd.yml +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-License-Identifier: 0BSD - -name: OpenBSD - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - workflow_dispatch: - -jobs: - OpenBSD-test: - runs-on: ubuntu-latest - name: Test xz on OpenBSD - steps: - - uses: actions/checkout@v4.1.6 - - name: Test in OpenBSD - id: test - uses: vmactions/OpenBSD-vm@eaa3d3f695a5a52971c23958f6dd4cd3397f959d #v1.0.8 - with: - usesh: true - prepare: | - /usr/sbin/pkg_add -I -v autoconf-2.71 automake-1.16.5 gmake gettext-tools gtar libtool m4 - run: | - set -e - export LC_ALL=C LANG=C - export AUTOCONF_VERSION=2.71 - export AUTOMAKE_VERSION=1.16 - uname -a - # OpenBSD ports lack po4a - ./autogen.sh --no-po4a - ./configure --enable-werror - make - make check VERBOSE=1 diff --git a/.github/workflows/solaris.yml b/.github/workflows/solaris.yml deleted file mode 100644 index fa2f703b..00000000 --- a/.github/workflows/solaris.yml +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-License-Identifier: 0BSD - -name: Solaris - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - workflow_dispatch: - -jobs: - solaris-test: - runs-on: ubuntu-latest - name: Test xz on Solaris - steps: - - uses: actions/checkout@v4.1.6 - - name: Test in Solaris - id: test - uses: vmactions/solaris-vm@548f790d1bc2b9342a76cbb47ddbb85875605559 #v1.0.2 - with: - usesh: true - prepare: | - pkg install bash libtool automake gnu-m4 tree wget gcc autoconf //solaris/text/gawk pkg://solaris/text/gnu-diffutils pkg://solaris/text/gnu-grep pkg://solaris/text/gnu-sed - run: | - set -e - export LC_ALL=C LANG=C - uname -a - ./autogen.sh --no-po4a - ./configure --enable-werror - make - make check VERBOSE=1 diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml deleted file mode 100644 index 0e0d3759..00000000 --- a/.github/workflows/windows-ci.yml +++ /dev/null @@ -1,124 +0,0 @@ -# SPDX-License-Identifier: 0BSD - -############################################################################# -# -# Author: Jia Tan -# -############################################################################# - -name: Windows-CI - -# Only run the Windows CI manually since it takes much longer than the others. -on: workflow_dispatch - -jobs: - POSIX: - strategy: - matrix: - # Test different environments since the code may change between - # them and we want to ensure that we support all potential users. - # clang64 builds are currently broken when building static libraries - # due to a bug in ldd search path: - # https://github.com/llvm/llvm-project/issues/67779 - # TODO - re-enable clang64 when this is resolved. - msys2_env: [mingw64, mingw32, ucrt64, msys] - build_system: [autotools, cmake] - - # Set the shell to be msys2 as a default to avoid setting it for - # every individual run command. - defaults: - run: - shell: msys2 {0} - - runs-on: windows-latest - - steps: - ##################### - # Setup Environment # - ##################### - - # Rely on the msys2 GitHub Action to set up the msys2 environment. - - name: Setup MSYS2 - uses: msys2/setup-msys2@cc11e9188b693c2b100158c3322424c4cc1dadea #v2.22.0 - with: - msystem: ${{ matrix.msys2_env }} - update: true - install: pactoys make - - - name: Checkout code - # Need to explicitly set the shell here since we set the default - # shell as msys2 earlier. This avoids an extra msys2 dependency on - # git. - shell: powershell - # Avoid Windows line endings. Otherwise test_scripts.sh will fail - # because the expected output is stored in the test framework as a - # text file and will not match the output from xzgrep. - run: git config --global core.autocrlf false - - - uses: actions/checkout@v4.1.6 - - - ######################## - # Install Dependencies # - ######################## - - # The pacman repository has a different naming scheme for default - # msys packages than the others. The pacboy tool allows installing - # the packages possible in matrix setup without a burdensome amount - # of ifs. - - name: Install Dependencies - if: ${{ matrix.msys2_env == 'msys' && matrix.build_system == 'autotools' }} - run: pacman --noconfirm -S --needed autotools base-devel doxygen gettext-devel gcc - - - name: Install Dependencies - if: ${{ matrix.msys2_env != 'msys' && matrix.build_system == 'autotools' }} - run: pacboy --noconfirm -S --needed autotools:p toolchain:p doxygen:p - - - name: Install Dependencies - if: ${{ matrix.msys2_env == 'msys' && matrix.build_system == 'cmake' }} - run: pacman --noconfirm -S --needed cmake base-devel gcc - - - name: Install Dependencies - if: ${{ matrix.msys2_env != 'msys' && matrix.build_system == 'cmake' }} - run: pacboy --noconfirm -S --needed cmake:p toolchain:p - - ################## - # Build and Test # - ################## - - - name: Build with full features - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -p build - - name: Test with full features - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -p test -n full_features - - - name: Build without threads - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p build - - name: Test without threads - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads - - - name: Build without encoders - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p build - - name: Test without encoders - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders - - - name: Build without decoders - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p build - - name: Test without decoders - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders - - - name: Build with only crc32 check - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p build - - name: Test with only crc32 check - run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p test -n crc32_only - - - ############### - # Upload Logs # - ############### - - # Upload the test logs as artifacts if any step has failed. - - uses: actions/upload-artifact@v4.3.3 - if: ${{ failure() }} - with: - name: ${{ matrix.msys2_env }} ${{ matrix.build_system }} Test Logs - path: build-aux/artifacts diff --git a/ci/ci.sh b/ci/ci.sh new file mode 100755 index 00000000..c4e9fb9d --- /dev/null +++ b/ci/ci.sh @@ -0,0 +1,142 @@ +#!/bin/sh +# +# Automated build and test of libarchive on CI systems +# +# Variables that can be passed via environment: +# BS= # build system (autotools or cmake) +# BUILDDIR= # build directory +# SRCDIR= # source directory +# CONFIGURE_ARGS= # configure arguments +# CMAKE_ARGS= # cmake arguments +# MAKE_ARGS= # make arguments +# DEBUG= # set -g -fsanitize=address flags + +ACTIONS= +BS="${BS:-autotools}" +MAKE="${MAKE:-make}" +CMAKE="${CMAKE:-cmake}" +CURDIR=`pwd` +SRCDIR="${SRCDIR:-`pwd`}" +RET=0 + +usage () { + echo "Usage: $0 [-b autotools|cmake] [-a autogen|configure|build|test|install ] [ -a ... ] [ -d builddir ] [-s srcdir ]" +} +inputerror () { + echo $1 + usage + exit 1 +} +case `uname` in + Darwin) + PATH=/usr/local/opt/gettext/bin:$PATH + ;; +esac +while getopts a:b:c:d:s: opt; do + case ${opt} in + a) + case "${OPTARG}" in + autogen) ;; + configure) ;; + build) ;; + test) ;; + install) ;; + distcheck) ;; + artifact) ;; + *) inputerror "Invalid action (-a)" ;; + esac + ACTIONS="${ACTIONS} ${OPTARG}" + ;; + b) BS="${OPTARG}" + case "${BS}" in + autotools) ;; + cmake) ;; + *) inputerror "Invalid build system (-b)" ;; + esac + ;; + d) + BUILDDIR="${OPTARG}" + ;; + s) + SRCDIR="${OPTARG}" + ;; + esac +done +if [ -z "${MAKE_ARGS}" ]; then + if [ "${BS}" = "autotools" ]; then + MAKE_ARGS="V=1" + elif [ "${BS}" = "cmake" ]; then + MAKE_ARGS="VERBOSE=1" + fi +fi +if [ -n "${DEBUG}" ]; then + if [ -n "${CFLAGS}" ]; then + export CFLAGS="${CFLAGS} -g -fsanitize=address" + else + export CFLAGS="-g -fsanitize=address" + fi + if [ "${BS}" = "cmake" ]; then + CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_C_CFLAGS=-g -fsanitize=address" + fi +fi +if [ -z "${ACTIONS}" ]; then + ACTIONS="autogen configure build test install" +fi +if [ -z "${BS}" ]; then + inputerror "Missing build system (-b) parameter" +fi +if [ -z "${BUILDDIR}" ]; then + BUILDDIR="${CURDIR}/build_ci/${BS}" +fi +mkdir -p "${BUILDDIR}" +for action in ${ACTIONS}; do + cd "${BUILDDIR}" + case "${action}" in + autogen) + case "${BS}" in + autotools) + cd "${SRCDIR}" + if type po4a; then + sh autogen.sh + else + sh autogen.sh --no-po4a + fi + RET="$?" + ;; + esac + ;; + configure) + case "${BS}" in + autotools) "${SRCDIR}/configure" ${CONFIGURE_ARGS} ;; + cmake) ${CMAKE} ${CMAKE_ARGS} "${SRCDIR}" ;; + esac + RET="$?" + ;; + build) + ${MAKE} ${MAKE_ARGS} + RET="$?" + ;; + test) + case "${BS}" in + autotools) + ${MAKE} ${MAKE_ARGS} check + ;; + cmake) + # not yet supported + # ${MAKE} ${MAKE_ARGS} test + ;; + esac + RET="$?" + ;; + install) + ${MAKE} ${MAKE_ARGS} install DESTDIR="${BUILDDIR}/destdir" + RET="$?" + cd "${BUILDDIR}/destdir" && ls -lR . + ;; + esac + if [ "${RET}" != "0" ]; then + exit "${RET}" + fi + cd "${CURDIR}" +done +exit "${RET}" diff --git a/ci/cirrus_ci/freebsd.sh b/ci/cirrus_ci/freebsd.sh new file mode 100755 index 00000000..1332fa87 --- /dev/null +++ b/ci/cirrus_ci/freebsd.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -x -e +env ASSUME_ALWAYS_YES=yes pkg bootstrap -f +pkg update +pkg install -y autoconf automake libtool cmake gettext po4a doxygen diff --git a/ci/github_actions/ci.cmd b/ci/github_actions/ci.cmd new file mode 100755 index 00000000..e2399540 --- /dev/null +++ b/ci/github_actions/ci.cmd @@ -0,0 +1,60 @@ +@ECHO OFF +IF NOT "%BE%"=="mingw-gcc" ( + IF NOT "%BE%"=="msvc" ( + ECHO Environment variable BE must be mingw-gcc or msvc + EXIT /b 1 + ) +) + +SET ORIGPATH=%PATH% +IF "%BE%"=="mingw-gcc" ( + SET MINGWPATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin +) + +IF "%1%"=="configure" ( + IF "%BE%"=="mingw-gcc" ( + SET PATH=%MINGWPATH% + MKDIR build_ci\cmake + CD build_ci\cmake + cmake -G "MinGW Makefiles" ..\.. || EXIT /b 1 + ) ELSE IF "%BE%"=="msvc" ( + MKDIR build_ci\cmake + CD build_ci\cmake + cmake -G "Visual Studio 17 2022" ..\.. || EXIT /b 1 + ) +) ELSE IF "%1%"=="build" ( + IF "%BE%"=="mingw-gcc" ( + SET PATH=%MINGWPATH% + CD build_ci\cmake + mingw32-make VERBOSE=1 || EXIT /b 1 + ) ELSE IF "%BE%"=="msvc" ( + CD build_ci\cmake + cmake --build . --target ALL_BUILD --config Release || EXIT /b 1 + ) +) ELSE IF "%1%"=="test" ( + IF "%BE%"=="mingw-gcc" ( + ECHO "Skipping tests" + EXIT /b 0 + REM SET PATH=%MINGWPATH% + REM CD build_ci\cmake + REM mingw32-make test VERBOSE=1 || EXIT /b 1 + ) ELSE IF "%BE%"=="msvc" ( + ECHO "Skipping tests" + EXIT /b 0 + REM CD build_ci\cmake + REM cmake --build . --target RUN_TESTS --config Release || EXIT /b 1 + ) +) ELSE IF "%1%"=="install" ( + IF "%BE%"=="mingw-gcc" ( + SET PATH=%MINGWPATH% + CD build_ci\cmake + mingw32-make install || EXIT /b 1 + ) ELSE IF "%BE%"=="msvc" ( + CD build_ci\cmake + cmake --build . --target INSTALL --config Release || EXIT /b 1 + ) +) ELSE ( + ECHO "Usage: %0% deplibs|configure|build|test|install" + @EXIT /b 0 +) +@EXIT /b 0 diff --git a/ci/github_actions/macos.sh b/ci/github_actions/macos.sh new file mode 100755 index 00000000..10d67918 --- /dev/null +++ b/ci/github_actions/macos.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -x -e +brew update > /dev/null +for pkg in autoconf automake libtool gettext doxygen +do + brew list $pkg > /dev/null && brew upgrade $pkg || brew install $pkg +done