preprocessor/.gitlab-ci.yml

139 lines
5.4 KiB
YAML

variables:
TERM: linux
MINGW32_BOOST_VERSION: 1.74.0-2
MINGW64_BOOST_VERSION: 1.74.0-2
WGET_OPTIONS: '--no-verbose --no-use-server-timestamps --retry-connrefused --retry-on-host-error'
before_script:
- 'export REMOTE_PATH=https://www.dynare.org/preprocessor/$CI_COMMIT_SHORT_SHA'
stages:
- build
- prepare
build_linux_32:
stage: build
script:
- autoreconf -si
- './configure LDFLAGS="-m32 -static -static-libgcc -static-libstdc++" CXXFLAGS=-m32'
- make -j$(nproc)
- strip src/dynare-preprocessor
- mkdir -p bin
- mv src/dynare-preprocessor bin
- mkdir -p $CI_COMMIT_SHORT_SHA/linux/32
- tar cfz $CI_COMMIT_SHORT_SHA/linux/32/preprocessor.tar.gz bin
- cd $CI_COMMIT_SHORT_SHA/linux/32 && sha256sum preprocessor.tar.gz > sha256sum
artifacts:
paths:
- $CI_COMMIT_SHORT_SHA/linux/32/*
expire_in: 1 day
build_linux_64:
stage: build
script:
- autoreconf -si
- './configure LDFLAGS="-static -static-libgcc -static-libstdc++"'
- make -j$(nproc)
- strip src/dynare-preprocessor
- mkdir -p bin
- mv src/dynare-preprocessor bin
- mkdir -p $CI_COMMIT_SHORT_SHA/linux/64
- tar cfz $CI_COMMIT_SHORT_SHA/linux/64/preprocessor.tar.gz bin
- cd $CI_COMMIT_SHORT_SHA/linux/64 && sha256sum preprocessor.tar.gz > sha256sum
artifacts:
paths:
- $CI_COMMIT_SHORT_SHA/linux/64/*
expire_in: 1 day
build_windows_32:
stage: build
script:
- mkdir -p ~/tarballs
- '[[ -f ~/tarballs/mingw-w64-i686-boost-$MINGW32_BOOST_VERSION-any.pkg.tar.zst ]] || wget $WGET_OPTIONS -P ~/tarballs http://repo.msys2.org/mingw/i686/mingw-w64-i686-boost-$MINGW32_BOOST_VERSION-any.pkg.tar.zst'
- mkdir -p deps
- tar xf ~/tarballs/mingw-w64-i686-boost-$MINGW32_BOOST_VERSION-any.pkg.tar.zst --directory deps
- autoreconf -si
- './configure --host=i686-w64-mingw32 --with-boost=$(pwd)/deps/mingw32/include LDFLAGS="-static -static-libgcc -static-libstdc++"'
- make -j$(nproc)
- i686-w64-mingw32-strip src/dynare-preprocessor.exe
- mkdir -p bin
- mv src/dynare-preprocessor.exe bin
- mkdir -p $CI_COMMIT_SHORT_SHA/windows/32
- tar cfz $CI_COMMIT_SHORT_SHA/windows/32/preprocessor.tar.gz bin
- cd $CI_COMMIT_SHORT_SHA/windows/32 && sha256sum preprocessor.tar.gz > sha256sum
artifacts:
paths:
- $CI_COMMIT_SHORT_SHA/windows/32/*
expire_in: 1 day
build_windows_64:
stage: build
script:
- mkdir -p ~/tarballs
- '[[ -f ~/tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst ]] || wget $WGET_OPTIONS -P ~/tarballs http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst'
- mkdir -p deps
- tar xf ~/tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst --directory deps
- autoreconf -si
- './configure --host=x86_64-w64-mingw32 --with-boost=$(pwd)/deps/mingw64/include LDFLAGS="-static -static-libgcc -static-libstdc++"'
- make -j$(nproc)
- x86_64-w64-mingw32-strip src/dynare-preprocessor.exe
- mkdir -p bin
- mv src/dynare-preprocessor.exe bin
- mkdir -p $CI_COMMIT_SHORT_SHA/windows/64
- tar cfz $CI_COMMIT_SHORT_SHA/windows/64/preprocessor.tar.gz bin
- cd $CI_COMMIT_SHORT_SHA/windows/64 && sha256sum preprocessor.tar.gz > sha256sum
artifacts:
paths:
- $CI_COMMIT_SHORT_SHA/windows/64/*
expire_in: 1 day
build_macOS:
stage: build
tags:
- macOS
script:
- autoreconf -si
- './configure CXX=g++-10 CXXFLAGS=-static-libgcc'
- make -j$(nproc)
- strip src/dynare-preprocessor
- mkdir -p bin
- mv src/dynare-preprocessor bin
- mkdir -p $CI_COMMIT_SHORT_SHA/macOS/64
- tar cfz $CI_COMMIT_SHORT_SHA/macOS/64/preprocessor.tar.gz bin
- cd $CI_COMMIT_SHORT_SHA/macOS/64 && sha256sum preprocessor.tar.gz > sha256sum
artifacts:
paths:
- $CI_COMMIT_SHORT_SHA/macOS/64/*
expire_in: 1 day
aggregate_builds:
stage: prepare
dependencies:
- build_linux_32
- build_linux_64
- build_windows_32
- build_windows_64
- build_macOS
script:
- linux32sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/linux/32/sha256sum)
- linux64sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/linux/64/sha256sum)
- windows32sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/windows/32/sha256sum)
- windows64sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/windows/64/sha256sum)
- macOS64sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/macOS/64/sha256sum)
- cd $CI_COMMIT_SHORT_SHA
- echo 'PREPROCESSOR_VERSION = "'$CI_COMMIT_SHORT_SHA'"' > julia.conf
- echo 'REMOTE_PATH = "https://www.dynare.org/preprocessor/'$CI_COMMIT_SHORT_SHA'"' >> julia.conf
- echo -e "\n" >> julia.conf
- echo "download_info = Dict(" >> julia.conf
- echo " Linux(:i686, :glibc) => ("\"\$REMOTE_PATH/linux/32/preprocessor.tar.gz\"", "\"$linux32sha\"")," >> julia.conf
- echo " Linux(:x86_64, :glibc) => ("\"\$REMOTE_PATH/linux/64/preprocessor.tar.gz\"", "\"$linux64sha\"")," >> julia.conf
- echo " Windows(:i686) => ("\"\$REMOTE_PATH/windows/32/preprocessor.tar.gz\"", "\"$windows32sha\"")," >> julia.conf
- echo " Windows(:x86_64) => ("\"\$REMOTE_PATH/windows/64/preprocessor.tar.gz\"", "\"$windows64sha\"")," >> julia.conf
- echo " MacOS() => ("\"\$REMOTE_PATH/macOS/64/preprocessor.tar.gz\"", "\"$macOS64sha\"")," >> julia.conf
- echo " )" >> julia.conf
artifacts:
paths:
- $CI_COMMIT_SHORT_SHA/*/*/*
- $CI_COMMIT_SHORT_SHA/julia.conf
expire_in: 1 week