Skip to content

Remove adding MATLAB path for tests #148

Remove adding MATLAB path for tests

Remove adding MATLAB path for tests #148

Workflow file for this run

name: using mpm to install MATLAB
on: push
jobs:
my-job:
name: Run MATLAB Script
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Create MATLAB install dir
run: mkdir matlab && cd matlab && mkdir R2022a
- name: MATLAB-2021b
uses: matlab-actions/setup-matlab@v1
- name: Script
run: matlab -batch matlabroot
# with:
# release: R2021b
# - name: MATLAB-2022a
# uses: matlab-actions/setup-matlab@v2-beta
# with:
# release: R2022a
# - name: Get mpm
# run: wget https://www.mathworks.com/mpm/glnxa64/mpm && chmod +x mpm
# - name: Install MATLAB
# run: ./mpm install --release=R2022a --destination=matlab/R2022a --products MATLAB
# - name: Check contents
# run: ls matlab/R2022a/bin
# - name: Add matlab to path
# run: cd matlab/R2022a/bin && export PATH=$(pwd):$PATH && printenv PATH
# - name: Get license 21b
# run: mkdir /home/runner/.matlab && cd /home/runner/.matlab/ && mkdir R2021b_licenses && cd R2021b_licenses && printenv LINUX_LIC > "license.lic" && ls
# env:
# LINUX_LIC: ${{ secrets.LINUX_R2021B}}
# - name: Set MATLAB_ROOT_21b
# run: matlab -batch version
# - name: Get license 22a
# run: mkdir /home/runner/.matlab && cd /home/runner/.matlab/ && mkdir R2022a_licenses && cd R2022a_licenses && printenv LINUX_LIC > "license.lic" && ls
# env:
# LINUX_LIC: ${{ secrets.LINUX_R2022A}}
# - name: Set MATLAB_ROOT
# run: matlab -batch version
# - name: Run MATLAB command
# run: cd matlab/R2022a/bin && ./matlab -batch pwd,matlabroot,version
# - name: Run MATLAB batch command
# run: matlab -batch version,matlabroot
# - name: Build project with Maven
# if: always()
# run: mvn -B clean test-compile failsafe:integration-test
# - name: Publish Test Report
# if: ${{ always() }}
# uses: scacap/action-surefire-report@v1
# with:
# report_paths: '**/failsafe-reports/TEST-*.xml'
# - name: Build project with Maven
# if: always()
# run: mvn -B clean test-compile failsafe:integration-test
# - uses: actions/upload-artifact@v2 # upload test results
# if: success() || failure() # run this step even if previous step failed
# with:
# name: test-results
# path: target/failsafe-reports
# - name: Publish Unit Test Results
# uses: EnricoMi/publish-unit-test-result-action/composite@v1
# if: always()
# with:
# files: test-results/failsafe-summary.xml
# report_individual_runs: "true"
# - uses: actions/upload-artifact@v2 # upload test results
# if: success() || failure() # run this step even if previous step failed
# with:
# name: test-results
# path: target/failsafe-reports
# - name: Report
# uses: dorny/test-reporter@v1
# if: always()
# with:
# name: Maven Tests
# path: test-results
# reporter: java-junit
# fail-on-error: true
# mvn -Dtest=RunMATLABCommandIT#verifyBuildPassesWhenMatlabCommandPasses test
#
# name: Install MATLAB
# runs-on: ubuntu-latest
# steps:
# - name: Get mpm
# run: wget https://www.mathworks.com/mpm/glnxa64/mpm && chmod +x mpm
# # - name: Install MATLAB
# # run: ./mpm install --release=R2022a --destination=matlab --products MATLAB
# - name: Create license Directory and file
# run: mkdir matlab && mkdir matlab/licenses && touch matlab/licenses/license.lic
# - name: base64 encoding
# run: echo "$LINUX_R2022A" > matlab/licenses/license_enc.lic &&cat matlab/licenses/license_enc.lic | base64 -d > matlab/licenses/license.lic
# - name: Get license
# run: printenv LINUX_LIC > "matlab/licenses/license.lic" && cat matlab/licenses/license.lic
# env:
# LINUX_LIC: ${{ secrets.LINUX_R2022A }}
# - name: test substring
# run: grep -q "ab\ncd" matlab/licenses/license.lic && echo "yes" || echo "no"
# - name: Run MATLAB
# run: export PATH=matlab/bin:$PATH && matlab -batch ver,pwd
# - name: 'Set up archived Oracle JDK 17.0.1'
# uses: oracle-actions/setup-java@v1
# with:
# website: oracle.com
# release: 17
# version: 17.0.1
# - name: Get mpm
# run: wget https://www.mathworks.com/mpm/glnxa64/mpm && chmod +x mpm
# - name: MATLAB install dir
# run: mkdir matlab
# - name: Install MATLAB
# run: ./mpm install --release=R2021b --destination=matlab --products MATLAB
# # Parallel_Computing_Toolbox Simulink Simulink_Test
# - name: Add matlab to path
# run: export PATH=$(pwd):$PATH && printenv PATH && printenv JAVA_HOME && ls /usr/lib/jvm/temurin-11-jdk-amd64
# - name: MATLAB-2022a
# uses: matlab-actions/setup-matlab@v2-beta
# with:
# release: R2022a
# - name: Run matlab command
# run: export PATH=$(pwd)/matlab/bin:$PATH && printenv JAVA_HOME && export MATLAB_JAVA=$JAVA_HOME && printenv MATLAB_JAVA && matlab -batch matlabroot,ver,parpool