Skip to content

Commit

Permalink
Merge pull request #783 from e0404/rc/v3
Browse files Browse the repository at this point in the history
Update to release v3 "Cleve"
  • Loading branch information
wahln authored Nov 18, 2024
2 parents 5b175b9 + 1bf700b commit b3527c3
Show file tree
Hide file tree
Showing 625 changed files with 51,394 additions and 15,613 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Version of new Release and Type (new major release, minor release, patch release

### Release Checklist

- [ ] Version number changed in matRad_getVersion
- [ ] Adapted Changelog.txt
- [ ] Adapted Changelog.md
- [ ] All required mex files compiled
- [ ] Third Party libraries / scripts up to date
- [ ] Standalone(s) generated and tested
- [ ] Wiki adapted
- [ ] Optional changes to README.md
- [ ] Check license information
- [ ] Version number changed in matRad_getVersion

### References
Any references regarding new functionality etc.
Expand Down
42 changes: 42 additions & 0 deletions .github/actions/test-matlab/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Matlab Test'
author: 'e0404'
description: 'Runs a Matlab Test for a given version'

inputs:
matlab-version:
description: Matlab Version, e.g. R2022b
required: true

runs:
using: 'composite'
steps:
# Install MATLAB
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ inputs.matlab-version }}
products: Image_Processing_Toolbox Parallel_Computing_Toolbox Optimization_Toolbox

# Runs test command
- name: Run Tests
uses: matlab-actions/run-command@v2
with:
command: matRad_runTests('test',true);

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-matlab-${{ inputs.matlab-version }}
path: |
testresults.xml
coverage.xml
coverage.json
- name: Publish Test Results
uses: test-summary/action@v2
if: success() || failure()
with:
paths: testresults.xml
# check_name: "${{ github.job }}"
39 changes: 39 additions & 0 deletions .github/actions/test-octave/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Octave Test'
author: 'e0404'
description: 'Runs an Octave test. Uses the version in the respective Ubuntu-OS'

runs:
using: 'composite'
steps:
- name: Install OCTAVE
shell: bash
run: |
sudo apt update
sudo apt-get install -y gdb gfortran fonts-freefont-otf gnuplot-x11 libgdcm-dev octave liboctave-dev
- name: Prepare Test Environment
shell: bash
run: |
sudo chmod +x .github/before_install_linux.sh
sudo .github/before_install_linux.sh
- name: Run Tests
shell: bash
run: xvfb-run -a .github/runtests.sh octave-cli
# uses: GabrielBB/xvfb-action@v1 #For Headless tests
# with:
# run: .github/runtests.sh octave-cli
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-octave
path: testresults.xml

- name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
uses: test-summary/action@v2
if: success() || failure()
with:
# files: |
# testresults.xml
paths: testresults.xml
# check_name: "${{ github.job }}"
5 changes: 3 additions & 2 deletions .github/before_install_linux.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env bash

sudo chmod +x .github/runtests.sh
sudo chmod +x MCsquare/bin/MCsquare_linux
sudo chmod +x thirdParty/MCsquare/bin/MCsquare_linux

mv optimization/optimizer/ipopt.m optimization/optimizer/ipopt.m.bak
mv matRad/optimization/optimizer/ipopt.m optimization/optimizer/ipopt.m.bak

octave --no-gui --eval "pkg install -forge dicom"
octave --no-gui --eval "pkg install -forge nan"
octave --no-gui --eval "pkg install -forge image"
2 changes: 2 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage:
range: 50...75
2 changes: 1 addition & 1 deletion .github/runtests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set CONTINUOUS_INTEGRATION=true
set CI=true

REM Actually run the test suite
cd unitTest
cd test
set TESTDIR="%cd%"
REM also CD in MATLAB/Octave to make sure that startup files
REM cannot play any role in setting the path
Expand Down
5 changes: 1 addition & 4 deletions .github/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ export CONTINUOUS_INTEGRATION=true
export CI=true

## Actually run the test suite
cd unitTest
TESTDIR=`pwd`
# also CD in MATLAB/Octave to make sure that startup files
# cannot play any role in setting the path
${Runner} ${Switches} "cd('${TESTDIR}'); matRad_runTests" > ../runtests.log #2> ../runtests.err put stdout to log, but let it print error messages
${Runner} ${Switches} "matRad_runTests('test');" > ../runtests.log #2> ../runtests.err put stdout to log, but let it print error messages
exitIfError $?
cd ..

66 changes: 66 additions & 0 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Coverage Report

permissions:
checks: write
pull-requests: write
actions: read
contents: read


on:
workflow_call:

jobs:
coverage_report:
runs-on: ubuntu-latest

steps:

- name: Download Coverage Artifact
uses: actions/download-artifact@v4
with:
name: test-results-matlab-R2022b
path: coverage

- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage/coverage.json
format: coveralls

- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/coverage.xml
fail_ci_if_error: false

- name: Publish Coverage Report
uses: irongut/[email protected]
with:
filename: coverage/coverage.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: true
hide_complexity: true
indicators: true
output: both
thresholds: '50 70'

- name: Attach Job Summary
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const markdownContent = fs.readFileSync('code-coverage-results.md', 'utf8');
core.summary.addRaw(markdownContent);
core.summary.write();
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
40 changes: 40 additions & 0 deletions .github/workflows/test-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test Report

permissions:
checks: write
pull-requests: write

on:
workflow_call:

jobs:
test_report:
runs-on: ubuntu-latest

steps:

- name: Download Results for Matlab R2022b
uses: actions/download-artifact@v4
with:
name: test-results-matlab-R2022b
path: test-results/matlab-R2022b

- name: Download Results for Matlab Latest
uses: actions/download-artifact@v4
with:
name: test-results-matlab-latest
path: test-results/matlab-latest

- name: Download Results for Octave
uses: actions/download-artifact@v4
with:
name: test-results-octave
path: test-results/octave

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
test-results/*/testresults.xml
71 changes: 33 additions & 38 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,52 @@
# This is a basic workflow to help you get started with Actions
name: Tests

permissions:
checks: write
pull-requests: write
actions: read
contents: read

# Controls when the action will run.
on: [push, pull_request, workflow_dispatch]
jobs:
test-matlab-stable: #Matlab test Job for supported Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # Checks-out repository under $GITHUB_WORKSPACE
# Install MATLAB
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
- uses: actions/checkout@v4 # Checks-out repository under $GITHUB_WORKSPACE
with:
release: R2022b
# Runs test command
- name: Run Tests
uses: matlab-actions/run-command@v1
submodules: 'true'
- name: Run Test
uses: ./.github/actions/test-matlab
with:
command: cd unitTest; matRad_runTests
matlab-version: R2022b

test-matlab-latest: #Matlab test Job for latest Matlab release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # Checks-out repository under $GITHUB_WORKSPACE
# Install MATLAB
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
- uses: actions/checkout@v4 # Checks-out repository under $GITHUB_WORKSPACE
with:
release: latest
# Runs test command
- name: Run Tests
uses: matlab-actions/run-command@v1
submodules: 'true'
- uses: ./.github/actions/test-matlab
with:
command: cd unitTest; matRad_runTests
matlab-version: latest

test-octave-6: #Octave test Job
runs-on: ubuntu-22.04 # We use Ubuntu-22.04 because it has Octave 6.4
steps:
- uses: actions/checkout@v3 # Checks-out repository under $GITHUB_WORKSPACE
- name: Install OCTAVE
run: |
sudo apt update
sudo apt-get install -y gdb gfortran fonts-freefont-otf gnuplot-x11 libgdcm-dev octave liboctave-dev
- name: Prepare Test Environment
run: |
sudo chmod +x .github/before_install_linux.sh
sudo .github/before_install_linux.sh
- name: Run Tests
run: xvfb-run -a .github/runtests.sh octave-cli
# uses: GabrielBB/xvfb-action@v1 #For Headless tests
# with:
# run: .github/runtests.sh octave-cli
- name: Upload logs if test fails
uses: actions/upload-artifact@v3
if: failure()
- uses: actions/checkout@v4 # Checks-out repository under $GITHUB_WORKSPACE
with:
name: Test Log
path: runtests.log

submodules: 'true'
- uses: ./.github/actions/test-octave

test-report:
name: Collect Test Results
needs: [test-matlab-stable, test-matlab-latest, test-octave-6]
uses: ./.github/workflows/test-results.yml
secrets: inherit

coverage-report:
name: Collect Coverage Report
needs: [test-matlab-stable]
uses: ./.github/workflows/coverage-report.yml
secrets: inherit
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
MCsquare/bin/Materials/
thirdParty/MCsquare/bin/Materials/
userdata/*
testresults.xml
coverage.xml
coverage.json
*.asv
build/
16 changes: 16 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
[submodule "submodules/matlab2tikz"]
path = submodules/matlab2tikz
url = https://github.com/e0404/matlab2tikz.git
branch = dev
[submodule "submodules/latexTable"]
path = submodules/latexTable
url = https://github.com/e0404/latexTable.git
branch = dev
[submodule "submodules/MCsquare"]
path = submodules/MCsquare
url = https://github.com/e0404/MCsquare.git
[submodule "submodules/ompMC"]
path = submodules/ompMC
url = https://github.com/e0404/ompMC
branch = dev_parallel
[submodule "submodules/MOxUnit"]
path = submodules/MOxUnit
url = https://github.com/e0404/MOxUnit
branch = matRad
[submodule "submodules/MOcov"]
path = submodules/MOcov
url = https://github.com/e0404/MOcov
branch = matRad
Loading

0 comments on commit b3527c3

Please sign in to comment.