Skip to content

Commit d6ea09a

Browse files
authored
Merge pull request #628 from e0404/hotfix/fixTestEnvironment
Hotfix to the test pipeline on the master branch
2 parents 689eabe + beaee4e commit d6ea09a

32 files changed

+179
-79
lines changed

.travis/before_install_linux.sh renamed to .github/before_install_linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
sudo chmod +x .travis/runtests.sh
3+
sudo chmod +x .github/runtests.sh
44
sudo chmod +x MCsquare/bin/MCsquare_linux
55

66
mv optimization/optimizer/ipopt.m optimization/optimizer/ipopt.m.bak
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

.travis/runtests.sh renamed to .github/runtests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
## Make sure some failures are detected by the CI runners
55
function exitIfError {
66
# pass "$?" as argument: i.e. the exit status of the last call
7-
if [ "$1" -ne 0 ]; then
7+
# currently octave 6 can finish with a segfault when the program is closed due to some bug, for now we try to ignore it
8+
if [ "$1" -ne 0 ] && [ "$1" -ne 139 ]; then
89
exit $1;
910
fi
1011
}

.github/workflows/tests.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,53 @@ name: Tests
33
# Controls when the action will run.
44
on: [push, pull_request, workflow_dispatch]
55
jobs:
6-
test-matlab: #Matlab test Job
6+
test-matlab-stable: #Matlab test Job for supported Release
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2 # Checks-out repository under $GITHUB_WORKSPACE
9+
- uses: actions/checkout@v3 # Checks-out repository under $GITHUB_WORKSPACE
1010
# Install MATLAB
1111
- name: Install MATLAB
12-
uses: matlab-actions/setup-matlab@v1
12+
uses: matlab-actions/setup-matlab@v1
13+
with:
14+
release: R2022b
1315
# Runs test command
1416
- name: Run Tests
1517
uses: matlab-actions/run-command@v1
1618
with:
1719
command: cd unitTest; matRad_runTests
18-
test-octave: #Octave test Job
19-
runs-on: ubuntu-20.04 # We use Ubuntu-20.04 because it has Octave 5.2
20+
test-matlab-latest: #Matlab test Job for latest Matlab release
21+
runs-on: ubuntu-latest
2022
steps:
21-
- uses: actions/checkout@v2 # Checks-out repository under $GITHUB_WORKSPACE
23+
- uses: actions/checkout@v3 # Checks-out repository under $GITHUB_WORKSPACE
24+
# Install MATLAB
25+
- name: Install MATLAB
26+
uses: matlab-actions/setup-matlab@v1
27+
with:
28+
release: latest
29+
# Runs test command
30+
- name: Run Tests
31+
uses: matlab-actions/run-command@v1
32+
with:
33+
command: cd unitTest; matRad_runTests
34+
test-octave-6: #Octave test Job
35+
runs-on: ubuntu-22.04 # We use Ubuntu-22.04 because it has Octave 6.4
36+
steps:
37+
- uses: actions/checkout@v3 # Checks-out repository under $GITHUB_WORKSPACE
2238
- name: Install OCTAVE
23-
run: sudo apt-get install -y gdb gfortran fonts-freefont-otf gnuplot-x11 libgdcm-dev octave liboctave-dev
39+
run: |
40+
sudo apt update
41+
sudo apt-get install -y gdb gfortran fonts-freefont-otf gnuplot-x11 libgdcm-dev octave liboctave-dev
2442
- name: Prepare Test Environment
2543
run: |
26-
sudo chmod +x .travis/before_install_linux.sh
27-
sudo .travis/before_install_linux.sh
28-
- name: Run Tests
29-
uses: GabrielBB/xvfb-action@v1 #For Headless tests
30-
with:
31-
run: .travis/runtests.sh octave-cli
32-
- name: Upload Logs if failure
33-
uses: actions/upload-artifact@v2
44+
sudo chmod +x .github/before_install_linux.sh
45+
sudo .github/before_install_linux.sh
46+
- name: Run Tests
47+
run: xvfb-run -a .github/runtests.sh octave-cli
48+
# uses: GabrielBB/xvfb-action@v1 #For Headless tests
49+
# with:
50+
# run: .github/runtests.sh octave-cli
51+
- name: Upload logs if test fails
52+
uses: actions/upload-artifact@v3
3453
if: failure()
3554
with:
3655
name: Test Log

MCsquare/matRad_compileMCsquareSparseReader.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function matRad_compileMCsquareSparseReader(dest,sourceFolder)
4343
end
4444

4545
if exist ('OCTAVE_VERSION', 'builtin')
46-
ccName = eval('mkoctfile -p CXX');
46+
ccName = evalc('mkoctfile -p CXX');
4747
else
4848
myCCompiler = mex.getCompilerConfigurations('C','Selected');
4949
ccName = myCCompiler.ShortName;
27.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)