Gitlab CI和Matlab

时间:2019-06-27 23:03:34

标签: matlab gitlab-ci gitlab-ci-runner

我正在尝试为gitlab上的相当大的Matlab代码设置一些测试。

我创建了.gitlab-ci.yml文件,该文件启动bash脚本,然后调用matlab。

#.gitlab-ci.yml

before_script:

Test:
  script:
    - chmod +x RunTests.sh
    - ./RunTests.sh

bash脚本如下:

# RunTests.sh
cd IntegratedTests

LOGFILE=log.txt

matlab -nodesktop -nosplash -minimize -wait -logfile "$LOGFILE" -r 'RunTests';
CODE=$?

cat "$LOGFILE"

exit $CODE

但是,gitlab尝试使用共享的gitlab-runner,该共享器使用来自ruby的docker映像。测试最终失败,因为它无法在docker-image上找到matlab。

Running with gitlab-runner 12.0.0-rc1 (58d8360f)
  on docker-auto-scale ed2dce3a
Using Docker executor with image ruby:2.5 ...
Pulling docker image ruby:2.5 ...
Using docker image sha256:80f53b90f8657c63c8d35d5eff399e6410baf19013c3b4c1c4158b2029060147 for ruby:2.5 ...
Running on runner-ed2dce3a-project-11747478-concurrent-0 via runner-ed2dce3a-srm-1561674473-a1c90512...
Fetching changes...
Initialized empty Git repository in /builds/darsim2simulator/darsim2/.git/
Created fresh repository.
From https://gitlab.com/darsim2simulator/darsim2
 * [new branch]      3-fixed-time-step-size -> origin/3-fixed-time-step-size
 * [new branch]      4-single-temperature-formulation-for-geothermal -> origin/4-single-temperature-formulation-for-geothermal
 * [new branch]      FIMLTS                 -> origin/FIMLTS
 * [new branch]      master                 -> origin/master
 * [new branch]      patch-1                -> origin/patch-1
 * [new branch]      patch-2                -> origin/patch-2
 * [new branch]      patch-3                -> origin/patch-3
Checking out ff3f0a4f as master...

Skipping Git submodules setup
$ chmod +x RunTests.sh
$ ./RunTests.sh
./RunTests.sh: line 6: matlab: command not found
cat: log.txt: No such file or directory
ERROR: Job failed: exit code 1

我猜测问题是docker-image上未安装matlab

这是我第一次使用gilab CI,因此我可能不正确地理解如何使用它,但是我有什么选择?如何设置具有matlab的跑步者?

1 个答案:

答案 0 :(得分:0)

对于我们项目中的特定跑步者,我在class cColor { public: enum eValue { k_Red, k_Green, k_Blue }; // AUTO TRICK MAKES THIS WORK static constexpr auto Values() { return std::array<eValue, NumValues>{k_Red, k_Green, k_Blue}; } static constexpr std::size_t NumValues = 3; };

中为工作指定标签

类似的东西:

.gitlab-ci.yml

更多信息

https://docs.gitlab.com/ee/ci/yaml/#tags