dynare/.gitlab-ci.yml

239 lines
7.9 KiB
YAML
Raw Normal View History

2018-09-12 18:53:44 +02:00
variables:
GIT_SUBMODULE_STRATEGY: recursive
TERM: linux
MATLAB_VERSION: R2020a
OLD_MATLAB_VERSION: R2014a
2018-09-12 18:53:44 +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 Enterprise repository:
# + if on a tag: use the tag
# + if on master: use enterprise-unstable-$TIMESTAMP-$COMMIT
# + on another branch: use $BRANCH-$TIMESTAMP-$COMMIT
# - if in a personal repository: use $USER-$TIMESTAMP-$COMMIT
before_script:
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Enterprise ]] && [[ -n $CI_COMMIT_TAG ]] && export VERSION=$CI_COMMIT_TAG'
2019-10-03 21:38:05 +02:00
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Enterprise ]] && [[ $CI_COMMIT_REF_NAME == enterprise ]] && export VERSION=enterprise-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA'
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Enterprise ]] && 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'
stages:
- build
- test_and_pkg
- deploy
2018-09-12 18:49:48 +02:00
build_binaries:
stage: build
script:
- autoreconf -si
- ./configure --with-matlab=/usr/local/MATLAB/$MATLAB_VERSION MATLAB_VERSION=$MATLAB_VERSION PACKAGE_VERSION=$VERSION PACKAGE_STRING="dynare $VERSION"
- make -j $(nproc) LN_S="cp -p"
2018-09-12 18:49:48 +02:00
artifacts:
paths:
- 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++
expire_in: 1 week
2018-09-12 18:49:48 +02:00
build_doc:
stage: build
script:
- autoreconf -si
- ./configure --disable-matlab --disable-octave PACKAGE_VERSION=$VERSION PACKAGE_STRING="dynare $VERSION"
- make -j $(nproc) pdf html
2018-09-12 18:49:48 +02:00
artifacts:
paths:
- doc/manual/build/
- doc/*.pdf
- doc/*/*.pdf
- dynare++/doc/*.pdf
- preprocessor/doc/*/*.pdf
expire_in: 1 week
2018-09-13 16:18:23 +02:00
pkg_source:
stage: test_and_pkg
script:
- rm doc/manual/source/_static/mathjax && sed -i "/^mathjax_path *=/d" doc/manual/source/conf.py
- '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
- ./configure --with-matlab=/usr/local/MATLAB/$MATLAB_VERSION MATLAB_VERSION=$MATLAB_VERSION
- make dist
artifacts:
paths:
- dynare-*.tar.xz
expire_in: 1 week
dependencies: []
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/sources64/
- windows/deps/lib64/
# We do not cache lib64-msys2, mingw64, octave64 and
# matlab64, because those are simply extracted from a tarball. It
# would be a waste of space and of (re-compression) time.
artifacts:
paths:
- windows/exe/*
- windows/7z/*
- windows/zip/*
expire_in: 1 week
dependencies:
- build_doc
pkg_macOS:
stage: test_and_pkg
script:
- ln -s ~/tarballs macOS/deps/
- make -C macOS
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- macOS/deps/sources64/
- macOS/deps/lib64/
tags:
- macOS
artifacts:
paths:
- macOS/pkg/*
expire_in: 1 week
dependencies:
- build_doc
2019-03-25 17:39:55 +01:00
.test_matlab_template:
stage: test_and_pkg
artifacts:
paths:
- tests/*.m.log
- tests/*.m.trs
- tests/*/*.m.log
- tests/*/*.m.trs
2019-02-01 14:51:48 +01:00
- tests/*/*.jnl
- tests/*/*/*.m.log
- tests/*/*/*.m.trs
2019-02-01 14:51:48 +01:00
- tests/*/*/*.jnl
- 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
script:
- autoreconf -si
- ./configure --disable-octave --with-matlab=/usr/local/MATLAB/$MATLAB_VERSION MATLAB_VERSION=$MATLAB_VERSION
- make -j $(($(nproc) * 3 / 4)) -C tests check-matlab
test_old_matlab:
2019-03-25 17:39:55 +01:00
extends: .test_matlab_template
script:
- autoreconf -si
- ./configure --disable-octave --with-matlab=/usr/local/MATLAB/$OLD_MATLAB_VERSION MATLAB_VERSION=$OLD_MATLAB_VERSION
- make -C mex/build/matlab clean
- make -j $(nproc) -C mex/build/matlab
- make -j $(($(nproc) * 3 / 4)) -C tests check-matlab
when: manual
test_octave:
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
artifacts:
paths:
- tests/*.o.log
- tests/*.o.trs
- tests/*/*.o.log
- tests/*/*.o.trs
2019-02-01 14:51:48 +01:00
- tests/*/*.jnl
- tests/*/*/*.o.log
- tests/*/*/*.o.trs
2019-02-01 14:51:48 +01:00
- tests/*/*/*.jnl
- tests/run_test_octave_output.txt
when: always
2018-09-13 16:18:23 +02:00
dependencies:
- build_binaries
when: manual
2019-01-24 17:56:43 +01:00
test_dynare++:
stage: test_and_pkg
2019-01-24 17:56:43 +01:00
script:
- autoreconf -si
- ./configure --disable-matlab --disable-octave
- 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
artifacts:
paths:
- dynare++/kord/out.txt
- dynare++/tests/*.jnl
- dynare++/tests/*.m
- dynare++/tests/*.mat
- dynare++/tests/*.dump
deploy_snapshot_enterprise:
stage: deploy
rules:
- if: '$CI_PROJECT_NAMESPACE == "Enterprise" && $CI_COMMIT_REF_NAME == "enterprise"'
when: on_success
- when: never
tags:
- restricted
dependencies:
- pkg_source
- pkg_windows
- pkg_macOS
script:
- f=(windows/exe/*) && osslsigncode sign -pkcs12 ~/cepremap-comodo-sectigo-code-signing.p12 -n Dynare -i https://www.dynare.org -t http://timestamp.comodoca.com -in ${f[0]} -out ${f[0]}.signed && mv ${f[0]}.signed ${f[0]}
- cp *.tar.xz /srv/www.dynare.org/snapshot_ecb/source/ && ln -sf *.tar.xz /srv/www.dynare.org/snapshot_ecb/source/dynare-latest-src.tar.xz
- f=(windows/exe/*) && cp ${f[0]} /srv/www.dynare.org/snapshot_ecb/windows/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot_ecb/windows/dynare-latest-win.exe
- f=(windows/7z/*) && cp ${f[0]} /srv/www.dynare.org/snapshot_ecb/windows-7z/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot_ecb/windows-7z/dynare-latest-win.7z
- f=(windows/zip/*) && cp ${f[0]} /srv/www.dynare.org/snapshot_ecb/windows-zip/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot_ecb/windows-zip/dynare-latest-win.zip
- f=(macOS/pkg/*) && cp ${f[0]} /srv/www.dynare.org/snapshot_ecb/macos/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot_ecb/macos/dynare-latest-macos.pkg
- ~/update-snapshot_ecb-list.sh
deploy_release_enterprise:
stage: deploy
rules:
- if: '$CI_PROJECT_NAMESPACE == "Enterprise" && $CI_COMMIT_TAG =~ /^enterprise-.*/'
when: on_success
- when: never
tags:
- restricted
dependencies:
- pkg_source
- pkg_windows
- pkg_macOS
script:
- f=(windows/exe/*) && osslsigncode sign -pkcs12 ~/cepremap-comodo-sectigo-code-signing.p12 -n Dynare -i https://www.dynare.org -t http://timestamp.comodoca.com -in ${f[0]} -out ${f[0]}.signed && mv ${f[0]}.signed ${f[0]}
- cp *.tar.xz /srv/www.dynare.org/release_ecb/source/
- cp windows/exe/* /srv/www.dynare.org/release_ecb/windows/
- cp windows/7z/* /srv/www.dynare.org/release_ecb/windows-7z/
- cp windows/zip/* /srv/www.dynare.org/release_ecb/windows-zip/
- cp macOS/pkg/* /srv/www.dynare.org/release_ecb/macos/