enable CI

This commit is contained in:
Matthew GONG
2020-03-18 09:52:09 +08:00
parent c70b0eb0eb
commit 1dc5e1412b
17 changed files with 159 additions and 0 deletions
+1
View File
@@ -8,4 +8,5 @@ rtwmakecfg.m
*__SFB.mat
*.zip
*.exe
log.txt
+39
View File
@@ -0,0 +1,39 @@
before_script:
stages:
- build
- test
build:
image: sh.matthewgong.com:5432/matt/gitlab-ci-matlab
stage: build
script:
- sh Gitlab_CI_Hook.sh
cache:
key: mex-cache
paths:
- "*.mexa64"
policy: push
tags:
- matlab
test:
image: sh.matthewgong.com:5432/matt/gitlab-ci-matlab
stage: test
script:
- cd test
- sh Gitlab_CI_Hook.sh
cache:
key: mex-cache
paths:
- "*.mexa64"
policy: pull
artifacts:
name: test_report
paths:
- test/*.zip
- test/log.txt
tags:
- matlab
+16
View File
@@ -0,0 +1,16 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.1.0] - 2020-03-18
### Added
- add changelog and release support
### Changed
- clean code, and move all tests to test directory
+4
View File
@@ -0,0 +1,4 @@
## contributor
* Zheng GONG (matt@matthewgong.com )
+17
View File
@@ -0,0 +1,17 @@
% runtests.m
% assume it always success
exit_code = 0;
% MATLAB runs the test
try
update_mex;
catch ME
report = getReport(ME)
disp(report);
exit_code = 1;
end
% Ensure that we ALWAYS call exit
exit(exit_code);
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
LOGFILE=log.txt
matlab -nodesktop -nosplash -wait -noFigureWindows -logfile "$LOGFILE" -r Git_MATLAB_interface;
CODE=$?
#cat "$LOGFILE"
exit $CODE
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Matthew GONG
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+11
View File
@@ -0,0 +1,11 @@
## simulink library for Hardware Abstract Layer(HAL) and code-gen support
[![pipeline status](http://sh.matthewgong.com/matt/slhal/badges/master/pipeline.svg)](http://sh.matthewgong.com/matt/slhal/commits/master)
本Simulink库提供了用于与飞控硬件接口的代码生成模块。只需要以template目录下的*_wrapper.c文件为模板编写接口文件,即可实现飞控代码的移植。
_______
Copyright (C) 2020 GONG Zheng(matt@matthewgong.com) http://www.matthewgong.com/
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+21
View File
@@ -0,0 +1,21 @@
% runtests.m
% assume it always fails
exit_code = 1;
% MATLAB runs the test
result = runtests(pwd);
ttt = table(result);
disp(ttt);
% check the result
if all(ttt.Passed) ~= 0 && all(ttt.Failed) == 0 && all(ttt.Incomplete) == 0
exit_code = 0;
end
fprintf('exit_code = %d\n',exit_code);
% Ensure that we ALWAYS call exit
exit(exit_code);
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
LOGFILE=log.txt
matlab -nodesktop -nosplash -wait -noFigureWindows -logfile "$LOGFILE" -r Git_MATLAB_interface;
CODE=$?
#cat "$LOGFILE"
exit $CODE
+11
View File
@@ -0,0 +1,11 @@
cd('..');
addpath template
%% Test mavlink_sim
fcn = 'hal_template';
feval(fcn, [], [], [], 'compile');
while strcmp(get_param(fcn, 'SimulationStatus'),'paused')
feval(fcn, [], [], [], 'term');
end
slbuild(fcn);