2018-09-12 18:53:44 +02:00
variables :
2019-11-22 14:32:11 +01:00
GIT_SUBMODULE_STRATEGY : recursive
2018-09-13 16:50:39 +02:00
TERM : linux
2020-01-24 16:18:08 +01:00
OLD_MATLAB_VERSION : R2009b
2018-09-12 18:53:44 +02:00
2019-09-06 17:37:16 +02:00
# The next stanza creates the version number used for the source tarball and the
# binary packages. Here are the following possible cases:
# - if VERSION was already set (when manually running a pipeline), use it
# - if we are in the official Dynare repository:
# + if on a tag: use the tag
2019-12-20 17:18:56 +01:00
# + if on master: use 4.7-unstable-$TIMESTAMP-$COMMIT
2019-09-06 17:37:16 +02:00
# + on another branch: use $BRANCH-$TIMESTAMP-$COMMIT
# - if in a personal repository: use $USER-$TIMESTAMP-$COMMIT
2019-11-26 15:08:33 +01:00
#
# Also sets the path and version of the default MATLAB installation.
2019-09-06 17:37:16 +02:00
before_script :
2019-09-17 14:04:54 +02:00
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ -n $CI_COMMIT_TAG ]] && export VERSION=$CI_COMMIT_TAG'
2019-12-20 17:18:56 +01:00
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ $CI_COMMIT_REF_NAME == master ]] && export VERSION=4.7-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA'
2019-09-17 14:04:54 +02:00
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && export VERSION=$CI_COMMIT_REF_NAME-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA'
- '[[ -z $VERSION ]] && export VERSION=$CI_PROJECT_NAMESPACE-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA'
2019-11-26 15:08:33 +01:00
- 'export MATLAB_PATH=$(dirname $(dirname $(readlink -f $(which matlab))))'
- 'export MATLAB_VERSION=$(echo version | matlab -nodesktop -nodisplay -nosplash 2>/dev/null | sed -En "/ans\ =/!d;n;n;s/^[^0-9]*([0-9]+\.[0-9]+).*$/\1/;p")'
2019-09-06 17:37:16 +02:00
2019-08-30 18:07:11 +02:00
stages :
- build
- test_and_pkg
- deploy
2018-09-12 18:49:48 +02:00
build_binaries :
stage : build
script :
- autoreconf -si
2019-11-26 15:08:33 +01:00
- ./configure --with-matlab=$MATLAB_PATH MATLAB_VERSION=$MATLAB_VERSION PACKAGE_VERSION=$VERSION PACKAGE_STRING="dynare $VERSION"
2018-09-12 19:08:43 +02:00
- make -j $(nproc) LN_S="cp -p"
2018-09-12 18:49:48 +02:00
artifacts :
paths :
2018-09-12 19:08:43 +02:00
- matlab/preprocessor*/*
2018-09-12 18:49:48 +02:00
- mex/octave/
- mex/matlab/
2019-01-24 17:56:43 +01:00
- dynare++/parser/cc/*_tab.cc
2019-01-24 19:57:21 +01:00
- dynare++/parser/cc/*_tab.hh
2019-01-24 17:56:43 +01:00
- dynare++/parser/cc/*_ll.cc
- dynare++/src/*_tab.cc
2019-01-24 19:57:21 +01:00
- dynare++/src/*_tab.hh
2019-01-24 17:56:43 +01:00
- dynare++/src/*_ll.cc
- dynare++/*/*.o
- dynare++/*/*.a
- dynare++/*/*/*.o
- dynare++/*/*/*.a
- dynare++/integ/src/quadrature-points
2018-09-12 18:49:48 +02:00
- dynare++/src/dynare++
2018-09-14 15:20:21 +02:00
expire_in : 1 week
2018-09-12 18:49:48 +02:00
build_doc :
stage : build
script :
- autoreconf -si
2019-10-15 12:03:32 +02:00
- ./configure --disable-matlab --disable-octave PACKAGE_VERSION=$VERSION PACKAGE_STRING="dynare $VERSION"
2019-02-21 16:58:18 +01:00
- make -j $(nproc) pdf html
2018-09-12 18:49:48 +02:00
artifacts :
paths :
2019-02-21 16:58:18 +01:00
- doc/manual/build/
2019-08-30 18:07:11 +02:00
- doc/*.pdf
- doc/*/*.pdf
- dynare++/doc/*.pdf
- preprocessor/doc/*/*.pdf
2019-02-21 17:12:13 +01:00
expire_in : 1 week
2018-09-13 16:18:23 +02:00
2019-09-06 17:59:07 +02:00
pkg_source :
stage : test_and_pkg
script :
2020-02-24 18:15:39 +01:00
- rm doc/manual/source/_static/mathjax && sed -i "/^mathjax_path *=/d" doc/manual/source/conf.py
2019-09-06 17:59:07 +02:00
- 'for f in configure.ac preprocessor/configure.ac mex/build/matlab/configure.ac mex/build/octave/configure.ac; do sed -i "s/^AC_INIT(\[\(.*\)\],\s*\[\(.*\)\])/AC_INIT([\1], [$VERSION])/" $f; done'
- autoreconf -si
2019-11-26 15:08:33 +01:00
- ./configure --with-matlab=$MATLAB_PATH MATLAB_VERSION=$MATLAB_VERSION
2019-09-06 17:59:07 +02:00
- make dist
artifacts :
paths :
- dynare-*.tar.xz
expire_in : 1 week
2019-09-17 15:54:12 +02:00
dependencies : [ ]
2019-09-06 17:59:07 +02:00
2019-08-30 18:07:11 +02:00
pkg_windows :
stage : test_and_pkg
script :
- ln -s ~/tarballs windows/deps/
- make -C windows
cache :
key : "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths :
- windows/deps/sources32/
- windows/deps/sources64/
- windows/deps/lib32/
- windows/deps/lib64/
2019-09-17 13:46:18 +02:00
# We do not cache lib{32,64}-msys2, mingw{32,64}, octave{32,64} and
# matlab{32,64}, because those are simply extracted from a tarball. It
# would be a waste of space and of (re-compression) time.
2019-08-30 18:07:11 +02:00
artifacts :
paths :
- windows/exe/*
2019-09-17 14:59:25 +02:00
- windows/7z/*
2019-08-30 18:07:11 +02:00
- windows/zip/*
expire_in : 1 week
dependencies :
- build_doc
2019-09-17 14:07:47 +02:00
pkg_macOS :
stage : test_and_pkg
script :
2019-09-30 16:45:36 +02:00
- ln -s ~/tarballs macOS/deps/
2019-09-17 14:07:47 +02:00
- make -C macOS
2019-09-30 16:45:36 +02:00
cache :
key : "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths :
- macOS/deps/sources64/
- macOS/deps/lib64/
2019-09-17 14:07:47 +02:00
tags :
- macOS
artifacts :
paths :
- macOS/pkg/*
expire_in : 1 week
dependencies :
- build_doc
2019-03-25 17:39:55 +01:00
.test_matlab_template :
2019-08-30 18:07:11 +02:00
stage : test_and_pkg
2018-09-13 16:50:39 +02:00
artifacts :
paths :
- tests/*.m.log
- tests/*.m.trs
- tests/*/*.m.log
- tests/*/*.m.trs
2019-02-01 14:51:48 +01:00
- tests/*/*.jnl
2018-10-02 15:51:55 +02:00
- tests/*/*/*.m.log
- tests/*/*/*.m.trs
2019-02-01 14:51:48 +01:00
- tests/*/*/*.jnl
2018-09-14 15:20:21 +02:00
- tests/run_test_matlab_output.txt
when : always
2018-09-13 16:18:23 +02:00
dependencies :
- build_binaries
2019-03-25 17:39:55 +01:00
test_matlab :
extends : .test_matlab_template
2019-03-25 17:38:13 +01:00
script :
- autoreconf -si
2019-11-26 15:08:33 +01:00
- ./configure --disable-octave --with-matlab=$MATLAB_PATH MATLAB_VERSION=$MATLAB_VERSION
2019-03-25 17:38:13 +01:00
- make -j $(($(nproc) * 3 / 4)) -C tests check-matlab
test_old_matlab :
2019-03-25 17:39:55 +01:00
extends : .test_matlab_template
2019-03-25 17:38:13 +01:00
script :
- autoreconf -si
2020-01-24 16:18:08 +01:00
- ./configure --disable-octave --with-matlab=/usr/local/MATLAB/$OLD_MATLAB_VERSION MATLAB_VERSION=$OLD_MATLAB_VERSION
2019-03-25 17:38:13 +01:00
- make -C mex/build/matlab clean
- make -j $(nproc) -C mex/build/matlab
- make -j $(($(nproc) * 3 / 4)) -C tests check-matlab
when : manual
2019-03-26 18:51:51 +01:00
test_octave :
2019-08-30 18:07:11 +02:00
stage : test_and_pkg
2018-09-13 16:18:23 +02:00
variables :
OPENBLAS_NUM_THREADS : 1
script :
- autoreconf -si
- ./configure --disable-matlab
- make -j $(nproc) -C tests check-octave
2018-09-13 16:50:39 +02:00
artifacts :
paths :
- tests/*.o.log
- tests/*.o.trs
- tests/*/*.o.log
- tests/*/*.o.trs
2019-02-01 14:51:48 +01:00
- tests/*/*.jnl
2018-10-02 15:51:55 +02:00
- tests/*/*/*.o.log
- tests/*/*/*.o.trs
2019-02-01 14:51:48 +01:00
- tests/*/*/*.jnl
2018-09-14 15:20:21 +02:00
- tests/run_test_octave_output.txt
when : always
2018-09-13 16:18:23 +02:00
dependencies :
- build_binaries
2018-09-14 15:20:21 +02:00
when : manual
2019-01-24 17:56:43 +01:00
test_dynare++ :
2019-08-30 18:07:11 +02:00
stage : test_and_pkg
2019-01-24 17:56:43 +01:00
script :
- autoreconf -si
- ./configure --disable-matlab --disable-octave
2019-09-17 11:17:33 +02:00
- touch dynare++/parser/cc/*_tab.cc dynare++/parser/cc/*_tab.hh dynare++/parser/cc/*_ll.cc dynare++/src/*_tab.cc dynare++/src/*_tab.hh dynare++/src/*_ll.cc
- touch dynare++/*/*.o dynare++/*/*/*.o
- touch dynare++/*/*.a dynare++/*/*/*.a
- touch dynare++/integ/src/quadrature-points dynare++/src/dynare++
2019-01-24 17:56:43 +01:00
- make -C dynare++ check
dependencies :
- build_binaries
2019-03-07 10:45:26 +01:00
artifacts :
paths :
- dynare++/kord/out.txt
2019-04-30 12:59:21 +02:00
- dynare++/tests/*.jnl
- dynare++/tests/*.m
- dynare++/tests/*.mat
- dynare++/tests/*.dump
2019-02-21 16:58:18 +01:00
deploy_manual_unstable :
stage : deploy
2020-01-20 18:05:26 +01:00
rules :
- if : '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"'
when : on_success
- when : never
2019-02-21 16:58:18 +01:00
tags :
2019-09-04 14:30:54 +02:00
- restricted
2019-02-21 16:58:18 +01:00
dependencies :
- build_doc
script :
- rm -rf doc/manual/build/html/_static/mathjax
- ln -s /usr/share/javascript/mathjax doc/manual/build/html/_static/mathjax
2019-09-04 14:30:54 +02:00
- rsync --recursive --links --delete doc/manual/build/html/ /srv/www.dynare.org/manual-unstable/
2019-09-06 18:17:20 +02:00
deploy_snapshot_unstable :
stage : deploy
2020-01-20 18:05:26 +01:00
rules :
- if : '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"'
when : on_success
- when : never
2019-09-06 18:17:20 +02:00
tags :
- restricted
dependencies :
- pkg_source
- pkg_windows
2019-09-17 14:07:47 +02:00
- pkg_macOS
2019-09-06 18:17:20 +02:00
script :
2019-09-12 11:04:09 +02:00
- f=(windows/exe/*) && osslsigncode sign -pkcs12 ~/dynare-object-signing.p12 -n Dynare -i https://www.dynare.org -in ${f[0]} -out ${f[0]}.signed && mv ${f[0]}.signed ${f[0]}
2019-09-11 15:03:23 +02:00
- cp *.tar.xz /srv/www.dynare.org/snapshot/source/ && ln -sf *.tar.xz /srv/www.dynare.org/snapshot/source/dynare-latest-src.tar.xz
2019-09-12 11:04:09 +02:00
- f=(windows/exe/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows/dynare-latest-win.exe
2019-09-17 14:59:25 +02:00
- f=(windows/7z/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows-7z/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows-7z/dynare-latest-win.7z
2019-09-12 11:04:09 +02:00
- f=(windows/zip/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows-zip/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows-zip/dynare-latest-win.zip
2019-09-17 14:07:47 +02:00
- f=(macOS/pkg/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/macos/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/macos/dynare-latest-macos.pkg
2019-09-09 17:19:40 +02:00
- ~/update-snapshot-list.sh
2019-09-23 14:49:20 +02:00
- curl -X POST -F token="$WEBSITE_PIPELINE_TRIGGER_TOKEN" -F ref=master https://git.dynare.org/api/v4/projects/40/trigger/pipeline