-
Notifications
You must be signed in to change notification settings - Fork 54
141 lines (122 loc) · 5.35 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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@v2-beta
- 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