Skip to content

Commit

Permalink
Use GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac-Ito-MW committed Nov 10, 2021
1 parent cec0bb8 commit 8320ddf
Show file tree
Hide file tree
Showing 20 changed files with 77 additions and 25 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# GitHub Actions Workflow with MATLAB Actions

# Copyright 2021 The MathWorks, Inc.

name: MATLAB Build

on:

push:
branches: [ main ]

pull_request:
branches: [ main ]

jobs:
matlab-job:
runs-on: ubuntu-latest
steps:

- name: Check out repository
uses: actions/checkout@v2

- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v1

- name: Run tests
uses: matlab-actions/run-command@v1
with:
command: openProject('HybridElectricVehicle.prj'); HEV_RunTests_Simple;
20 changes: 0 additions & 20 deletions .gitlab-ci.yml

This file was deleted.

Binary file modified HEV/PowerSplitHEV_SpeedTracking/PowerSplitHEV_SpeedTracking.slx
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design" />
</Category>
</Info>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="HEV_RunTests_Simple.m" type="File" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="1" type="DIR_SIGNIFIER" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="workflows" type="File" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="1" type="DIR_SIGNIFIER" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="ci.yml" type="File" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info />
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location=".github" type="File" />

This file was deleted.

2 changes: 1 addition & 1 deletion test/HEV_RunTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
%% Run test

results = runner.run(suite);
disp(results.assertSuccess);
assertSuccess(results);
19 changes: 19 additions & 0 deletions test/HEV_RunTests_Simple.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
%% Script to run unit test and generate report

% Copyright 2021 The MathWorks, Inc.

%% Create test suite

import matlab.unittest.TestSuite;
s1 = TestSuite.fromMethod(?HEV_UnitTest, 'minimalTest_HevSpeedTracking_10s');
suite = s1;

%% Create test runner

runner = matlab.unittest.TestRunner.withTextOutput( ...
'OutputDetail', matlab.unittest.Verbosity.Detailed);

%% Run tests

results = runner.run(suite);
assertSuccess(results);
4 changes: 2 additions & 2 deletions utils/onPrjOpen.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if not(contains(string(ver('matlab').Release), "R2021a"))
disp("This project was developed in R2021a.")
versionhar = ver('matlab').Release;
disp("This MATLAB Release is " + versionhar(2:end-1) + ".")
releaseStr = ver('matlab').Release;
disp("This MATLAB Release is " + releaseStr(2:end-1) + ".")
clear release
end

0 comments on commit 8320ddf

Please sign in to comment.