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
|
2023-09-22 10:52:57 +02:00
|
|
|
|
MATLAB_VERSION: R2023b
|
2023-11-22 13:24:52 +01:00
|
|
|
|
OLD_MATLAB_VERSION: R2018b
|
2023-11-23 12:27:21 +01:00
|
|
|
|
# To ensure that "false && true" fails, see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/25394#note_412609647
|
|
|
|
|
FF_ENABLE_BASH_EXIT_CODE_CHECK: 'true'
|
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
|
2021-01-12 20:08:34 +01:00
|
|
|
|
# - if we are in the official Dynare repository:
|
2019-09-06 17:37:16 +02:00
|
|
|
|
# + if on a tag: use the tag
|
2021-12-08 14:23:26 +01:00
|
|
|
|
# + if on master: use 6-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
|
|
|
|
|
before_script:
|
2023-11-23 12:27:21 +01:00
|
|
|
|
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ -n $CI_COMMIT_TAG ]]; then export VERSION=$CI_COMMIT_TAG; fi'
|
|
|
|
|
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ $CI_COMMIT_REF_NAME == master ]]; then export VERSION=6-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
|
|
|
|
|
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]]; then export VERSION=$CI_COMMIT_REF_NAME-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
|
|
|
|
|
- 'if [[ -z $VERSION ]]; then export VERSION=$CI_PROJECT_NAMESPACE-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
|
2019-09-06 17:37:16 +02:00
|
|
|
|
|
2019-08-30 18:07:11 +02:00
|
|
|
|
stages:
|
|
|
|
|
- build
|
2020-11-03 11:11:11 +01:00
|
|
|
|
- test
|
|
|
|
|
- pkg
|
2023-07-17 16:16:11 +02:00
|
|
|
|
- sign
|
2019-08-30 18:07:11 +02:00
|
|
|
|
- deploy
|
|
|
|
|
|
2023-09-20 13:07:30 +02:00
|
|
|
|
build_matlab:
|
2018-09-12 18:49:48 +02:00
|
|
|
|
stage: build
|
|
|
|
|
script:
|
2023-09-20 13:07:30 +02:00
|
|
|
|
- meson setup -Dbuild_for=matlab -Dmatlab_path=/opt/MATLAB/$MATLAB_VERSION -Dbuildtype=release build-matlab
|
|
|
|
|
- meson compile -v -C build-matlab
|
2018-09-12 18:49:48 +02:00
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
2023-09-20 13:07:30 +02:00
|
|
|
|
- build-matlab/
|
|
|
|
|
expire_in: 3 days
|
|
|
|
|
|
|
|
|
|
build_octave:
|
|
|
|
|
stage: build
|
|
|
|
|
script:
|
|
|
|
|
- meson setup -Dbuild_for=octave -Dbuildtype=release build-octave
|
|
|
|
|
- meson compile -v -C build-octave
|
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
|
|
|
|
- build-octave/
|
2021-01-27 10:13:38 +01:00
|
|
|
|
expire_in: 3 days
|
2018-09-12 18:49:48 +02:00
|
|
|
|
|
|
|
|
|
build_doc:
|
|
|
|
|
stage: build
|
|
|
|
|
script:
|
2023-09-18 14:52:55 +02:00
|
|
|
|
- meson rewrite kwargs set project / version "$VERSION"
|
2023-11-10 14:12:11 +01:00
|
|
|
|
# Use a local copy of MathJax to avoid using CDN (which are a privacy issue)
|
|
|
|
|
# NB: Debian 12 “Bookworm” has MathJax 2. The following needs to be updated
|
|
|
|
|
# when Debian moves to MathJax 3.
|
|
|
|
|
- meson setup -Dbuild_for=octave -Dmathjax_path=mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML build-doc
|
2023-09-18 14:52:55 +02:00
|
|
|
|
- meson compile -v -C build-doc doc
|
2023-11-10 14:12:11 +01:00
|
|
|
|
- cp -dR /usr/share/javascript/mathjax build-doc/dynare-manual.html/_static/
|
2018-09-12 18:49:48 +02:00
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
2023-09-18 14:52:55 +02:00
|
|
|
|
- build-doc/
|
2021-01-27 10:13:38 +01:00
|
|
|
|
expire_in: 3 days
|
2018-09-13 16:18:23 +02:00
|
|
|
|
|
2019-09-06 17:59:07 +02:00
|
|
|
|
pkg_source:
|
2020-11-03 11:11:11 +01:00
|
|
|
|
stage: pkg
|
2019-09-06 17:59:07 +02:00
|
|
|
|
script:
|
2023-09-19 17:41:29 +02:00
|
|
|
|
- meson rewrite kwargs set project / version "$VERSION"
|
|
|
|
|
- git commit -a -m "Source for $VERSION"
|
|
|
|
|
- meson setup -Dbuild_for=octave build-src
|
|
|
|
|
- meson dist -C build-src --no-tests
|
2019-09-06 17:59:07 +02:00
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
2023-09-19 17:41:29 +02:00
|
|
|
|
- build-src/meson-dist/dynare-*.tar.xz
|
2021-01-27 10:13:38 +01:00
|
|
|
|
expire_in: 3 days
|
2020-11-03 11:11:11 +01:00
|
|
|
|
needs: []
|
2019-09-06 17:59:07 +02:00
|
|
|
|
|
2019-08-30 18:07:11 +02:00
|
|
|
|
pkg_windows:
|
2020-11-03 11:11:11 +01:00
|
|
|
|
stage: pkg
|
2019-08-30 18:07:11 +02:00
|
|
|
|
script:
|
2023-09-19 16:52:49 +02:00
|
|
|
|
- meson rewrite kwargs set project / version "$VERSION"
|
2023-05-30 17:11:47 +02:00
|
|
|
|
- mkdir -p windows/deps/tarballs && cp /usr/lib/dynare-runner/matlab64-* windows/deps/tarballs/
|
2019-08-30 18:07:11 +02:00
|
|
|
|
- make -C windows
|
2023-05-15 15:34:12 +02:00
|
|
|
|
- rm windows/deps/tarballs/matlab64-* # No need to cache these files
|
2019-08-30 18:07:11 +02:00
|
|
|
|
cache:
|
2023-05-15 15:34:12 +02:00
|
|
|
|
- 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.
|
|
|
|
|
- key: $CI_JOB_NAME
|
|
|
|
|
# This cache is shared between all branches, to save space
|
|
|
|
|
paths:
|
|
|
|
|
- windows/deps/tarballs/
|
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/*
|
2021-01-27 10:13:38 +01:00
|
|
|
|
expire_in: 3 days
|
2020-11-03 11:11:11 +01:00
|
|
|
|
needs: [ "build_doc" ]
|
2019-08-30 18:07:11 +02:00
|
|
|
|
|
2023-10-11 17:23:53 +02:00
|
|
|
|
pkg_macOS_x86_64:
|
2020-11-03 11:11:11 +01:00
|
|
|
|
stage: pkg
|
2019-09-17 14:07:47 +02:00
|
|
|
|
script:
|
2023-10-11 17:01:16 +02:00
|
|
|
|
# Enforce the arm64 meson for rewrite, as a workaround to https://github.com/mesonbuild/meson/issues/12282
|
|
|
|
|
- env PATH="/opt/homebrew/bin:$PATH" meson rewrite kwargs set project / version "$VERSION"
|
2023-10-11 17:23:53 +02:00
|
|
|
|
- ln -s ~/tarballs macOS/deps/x86_64
|
|
|
|
|
- make -C macOS build-x86_64
|
2019-09-30 16:45:36 +02:00
|
|
|
|
cache:
|
|
|
|
|
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
|
|
|
|
paths:
|
2023-10-11 17:23:53 +02:00
|
|
|
|
- macOS/deps/x86_64/sources64/
|
|
|
|
|
- macOS/deps/x86_64/lib64/
|
|
|
|
|
tags:
|
|
|
|
|
- macOS
|
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
|
|
|
|
- macOS/pkg/*
|
|
|
|
|
expire_in: 3 days
|
|
|
|
|
needs: [ "build_doc" ]
|
|
|
|
|
|
|
|
|
|
pkg_macOS_arm64:
|
|
|
|
|
stage: pkg
|
|
|
|
|
script:
|
|
|
|
|
# Enforce the arm64 meson for rewrite, as a workaround to https://github.com/mesonbuild/meson/issues/12282
|
|
|
|
|
- env PATH="/opt/homebrew/bin:$PATH" meson rewrite kwargs set project / version "$VERSION"
|
|
|
|
|
- ln -s ~/tarballs macOS/deps/arm64
|
|
|
|
|
- make -C macOS build-arm64
|
|
|
|
|
cache:
|
|
|
|
|
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
|
|
|
|
paths:
|
|
|
|
|
- macOS/deps/arm64/sources64/
|
|
|
|
|
- macOS/deps/arm64/lib64/
|
2019-09-17 14:07:47 +02:00
|
|
|
|
tags:
|
|
|
|
|
- macOS
|
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
|
|
|
|
- macOS/pkg/*
|
2021-01-27 10:13:38 +01:00
|
|
|
|
expire_in: 3 days
|
2020-11-03 11:11:11 +01:00
|
|
|
|
needs: [ "build_doc" ]
|
2019-09-17 14:07:47 +02:00
|
|
|
|
|
2023-09-20 13:07:30 +02:00
|
|
|
|
test_matlab:
|
2020-11-03 11:11:11 +01:00
|
|
|
|
stage: test
|
2023-09-20 13:07:30 +02:00
|
|
|
|
script:
|
|
|
|
|
- meson test -C build-matlab --no-rebuild --num-processes $(($(nproc) * 3 / 4))
|
2018-09-13 16:50:39 +02:00
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
2023-09-20 13:07:30 +02:00
|
|
|
|
- build-matlab/meson-logs/testlog.txt
|
2018-09-14 15:20:21 +02:00
|
|
|
|
when: always
|
2023-09-20 13:07:30 +02:00
|
|
|
|
needs: [ "build_matlab" ]
|
2019-03-25 17:38:13 +01:00
|
|
|
|
|
|
|
|
|
test_old_matlab:
|
2023-09-20 13:07:30 +02:00
|
|
|
|
stage: test
|
2019-03-25 17:38:13 +01:00
|
|
|
|
script:
|
2023-09-20 13:07:30 +02:00
|
|
|
|
- meson setup -Dbuild_for=matlab -Dmatlab_path=/opt/MATLAB/$OLD_MATLAB_VERSION -Dbuildtype=release build-old-matlab
|
|
|
|
|
- meson compile -v -C build-old-matlab
|
|
|
|
|
- meson test -C build-old-matlab --num-processes $(($(nproc) * 3 / 4))
|
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
|
|
|
|
- build-old-matlab/meson-logs/testlog.txt
|
|
|
|
|
when: always
|
2019-03-25 17:38:13 +01:00
|
|
|
|
when: manual
|
|
|
|
|
|
2019-03-26 18:51:51 +01:00
|
|
|
|
test_octave:
|
2020-11-03 11:11:11 +01:00
|
|
|
|
stage: test
|
2018-09-13 16:18:23 +02:00
|
|
|
|
variables:
|
|
|
|
|
OPENBLAS_NUM_THREADS: 1
|
|
|
|
|
script:
|
2023-09-20 13:07:30 +02:00
|
|
|
|
- meson test -C build-octave --no-rebuild
|
2018-09-13 16:50:39 +02:00
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
2023-09-20 13:07:30 +02:00
|
|
|
|
- build-octave/meson-logs/testlog.txt
|
2018-09-14 15:20:21 +02:00
|
|
|
|
when: always
|
2023-09-20 13:07:30 +02:00
|
|
|
|
needs: [ "build_octave" ]
|
2018-09-14 15:20:21 +02:00
|
|
|
|
when: manual
|
2019-01-24 17:56:43 +01:00
|
|
|
|
|
2023-11-29 19:02:41 +01:00
|
|
|
|
test_clang_format:
|
|
|
|
|
stage: test
|
|
|
|
|
script:
|
|
|
|
|
- meson setup -Dbuild_for=octave build-clang-format
|
|
|
|
|
- ninja -C build-clang-format clang-format-check
|
|
|
|
|
needs: []
|
|
|
|
|
|
2023-07-17 16:16:11 +02:00
|
|
|
|
# For the sign and deploy jobs, we don’t use the “needs” keyword, since we
|
|
|
|
|
# don’t want those jobs to start before the “test” and “pkg” stages have
|
|
|
|
|
# succeeded. Hence we stick to the “dependencies” keyword.
|
|
|
|
|
|
|
|
|
|
sign_windows:
|
|
|
|
|
stage: sign
|
|
|
|
|
rules:
|
|
|
|
|
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"'
|
|
|
|
|
when: on_success
|
|
|
|
|
- when: never
|
|
|
|
|
tags:
|
|
|
|
|
- sign
|
|
|
|
|
dependencies:
|
|
|
|
|
- pkg_windows
|
|
|
|
|
script:
|
|
|
|
|
- f=(windows/exe/*) && mkdir -p windows/exe-signed/ && osslsigncode sign -pkcs11module /usr/lib/x86_64-linux-gnu/libykcs11.so.2 -key "pkcs11:id=%01;type=private;pin-value=$YUBIKEY_PIN" -certs ~/cepremap-code-signing-comodo-sectigo.pem -n Dynare -i https://www.dynare.org -t http://timestamp.comodoca.com -in ${f[0]} -out windows/exe-signed/${f[0]##*/}
|
|
|
|
|
artifacts:
|
|
|
|
|
paths:
|
|
|
|
|
- windows/exe-signed/*
|
|
|
|
|
expire_in: 3 days
|
2020-11-03 11:11:11 +01:00
|
|
|
|
|
2021-01-12 20:08:34 +01:00
|
|
|
|
deploy_manual_unstable:
|
2019-02-21 16:58:18 +01:00
|
|
|
|
stage: deploy
|
2020-01-21 10:08:23 +01:00
|
|
|
|
rules:
|
2021-01-12 20:08:34 +01:00
|
|
|
|
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"'
|
2020-01-21 10:08:23 +01:00
|
|
|
|
when: on_success
|
|
|
|
|
- when: never
|
2019-10-03 17:32:53 +02:00
|
|
|
|
tags:
|
2023-07-17 16:16:11 +02:00
|
|
|
|
- deploy
|
2019-10-03 17:32:53 +02:00
|
|
|
|
dependencies:
|
2021-01-12 20:08:34 +01:00
|
|
|
|
- build_doc
|
2019-10-03 17:32:53 +02:00
|
|
|
|
script:
|
2023-09-18 14:52:55 +02:00
|
|
|
|
- rsync --recursive --links --delete build-doc/dynare-manual.html/ /srv/www.dynare.org/manual-unstable/
|
2019-10-15 11:40:23 +02:00
|
|
|
|
|
2021-01-12 20:08:34 +01:00
|
|
|
|
deploy_snapshot_unstable:
|
2019-10-15 11:40:23 +02:00
|
|
|
|
stage: deploy
|
2020-01-21 10:08:23 +01:00
|
|
|
|
rules:
|
2021-01-12 20:08:34 +01:00
|
|
|
|
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"'
|
2020-01-21 10:08:23 +01:00
|
|
|
|
when: on_success
|
|
|
|
|
- when: never
|
2019-10-15 11:40:23 +02:00
|
|
|
|
tags:
|
2023-07-17 16:16:11 +02:00
|
|
|
|
- deploy
|
2019-10-15 11:40:23 +02:00
|
|
|
|
dependencies:
|
|
|
|
|
- pkg_source
|
|
|
|
|
- pkg_windows
|
2023-07-17 16:16:11 +02:00
|
|
|
|
- sign_windows
|
2023-10-18 02:34:31 +02:00
|
|
|
|
- pkg_macOS_arm64
|
2023-10-11 17:23:53 +02:00
|
|
|
|
- pkg_macOS_x86_64
|
2019-10-15 11:40:23 +02:00
|
|
|
|
script:
|
2023-09-19 17:41:29 +02:00
|
|
|
|
- cp build-src/meson-dist/*.tar.xz /srv/www.dynare.org/snapshot/source/ && ln -sf *.tar.xz /srv/www.dynare.org/snapshot/source/dynare-latest-src.tar.xz
|
2023-07-17 16:16:11 +02:00
|
|
|
|
- f=(windows/exe-signed/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows/dynare-latest-win.exe
|
2021-01-12 20:08:34 +01: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
|
|
|
|
|
- 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
|
2023-10-18 02:34:31 +02:00
|
|
|
|
- f=(macOS/pkg/*-arm64.pkg) && cp ${f[0]} /srv/www.dynare.org/snapshot/macos-arm64/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/macos-arm64/dynare-latest-macos-arm64.pkg
|
|
|
|
|
- f=(macOS/pkg/*-x86_64.pkg) && cp ${f[0]} /srv/www.dynare.org/snapshot/macos-x86_64/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/macos-x86_64/dynare-latest-macos-x86_64.pkg
|
2021-01-12 20:08:34 +01:00
|
|
|
|
- ~/update-snapshot-list.sh
|
|
|
|
|
- curl -X POST -F token="$WEBSITE_PIPELINE_TRIGGER_TOKEN" -F ref=master https://git.dynare.org/api/v4/projects/40/trigger/pipeline
|