3131 required : false
3232 type : boolean
3333 default : false
34-
34+
3535 test_dpf :
3636 description : |
3737 If true, the DPF tests will be run.
3838 required : false
3939 type : boolean
4040 default : true
41-
41+
4242 on-console :
4343 description : |
4444 If true, the tests will be run on console.
4545 required : false
4646 type : boolean
4747 default : false
4848
49+ upload-logs :
50+ description : |
51+ If true, logs will be uploaded encrypted. Set to false to disable log upload (for security).
52+ required : false
53+ type : boolean
54+ default : false
55+
4956 file-name :
5057 description : |
5158 Name of the file to save the logs.
7279 required : false
7380 type : string
7481 default : ghcr.io/ansys/mapdl
75-
82+
7683 runner :
7784 description : |
7885 Runner to use.
8693 required : false
8794 type : string
8895 default : " 3.12"
89-
96+
9097 secrets :
9198 license-server :
9299 description : |
97104 description : |
98105 Token for Codecov.
99106 required : true
100-
107+
108+ log-encryption-key :
109+ description : |
110+ Encryption key for sensitive log files.
111+ required : false
112+
101113 token :
102114 description : |
103115 Token for GitHub. Used also for login into ghcr.io.
104116 required : true
105-
117+
106118 username :
107119 description : |
108120 GitHub username for login into ghcr.io.
@@ -126,7 +138,7 @@ jobs:
126138 TESTING_MINIMAL : ${{ inputs.testing-minimal }}
127139 P_SCHEMA : " /ansys_inc/v241/ansys/ac4/schema"
128140 PYTEST_TIMEOUT : 120 # seconds. Limit the duration for each unit test
129- PYTEST_ARGUMENTS : ' -vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers'
141+ PYTEST_ARGUMENTS : ' -vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=2 --reruns 2 --reruns-delay 2 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers'
130142 OMPI_ALLOW_RUN_AS_ROOT : 1
131143 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM : 1
132144 DATAPROCESSING_DEBUG : /home/mapdl/dpf_logs
@@ -168,31 +180,32 @@ jobs:
168180 if [[ "${MAPDL_VERSION}" == *"cicd"* ]]; then
169181 echo "CICD MAPDL version detected, testing DPF backend for results module.";
170182 echo "TEST_DPF_BACKEND=true" >> $GITHUB_ENV;
183+ echo "PYMAPDL_ADDITIONAL_SWITCHES=-mpi openmpi" >> $GITHUB_ENV;
171184 fi
172185
173186 echo "ON_STUDENT: $ON_STUDENT"
174187 echo "TAG_STUDENT: $TAG_STUDENT"
175188 echo "ON_STUDENT=$(echo $ON_STUDENT)" >> $GITHUB_OUTPUT
176189 echo "TAG_STUDENT=$(echo $TAG_STUDENT)" >> $GITHUB_OUTPUT
177-
190+
178191 - name : " Install gcc"
179192 shell : bash
180193 if : ${{ contains(inputs.mapdl-version, 'cicd') }}
181194 run : |
182195 apt-get update && apt-get -y install gcc mono-mcs g++
183-
196+
184197
185198 - name : " Installing minimal OS packages"
186199 shell : bash
187200 if : inputs.testing-minimal == true
188201 run : |
189- apt-get update && apt install -y libgomp1 graphviz curl && apt-get clean
202+ apt-get update && apt install -y libgomp1 graphviz curl git && apt-get clean
190203
191204 - name : " Installing OS packages"
192205 shell : bash
193206 if : inputs.testing-minimal == false
194207 run : |
195- apt-get update && apt install -y libgl1 libglx-mesa0 xvfb libgomp1 graphviz curl && apt-get clean
208+ apt-get update && apt install -y libgl1 libglx-mesa0 xvfb libgomp1 graphviz curl git && apt-get clean
196209
197210 - name : " Setup Python"
198211 uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
@@ -250,7 +263,7 @@ jobs:
250263 echo "ON_UBUNTU: $ON_UBUNTU"
251264 echo "ON_STUDENT: $ON_STUDENT"
252265
253- # Because there is no 'ansys-tools-path ' we need to input the
266+ # Because there is no 'ansys-tools-common ' we need to input the
254267 # executable path with the env var: PYMAPDL_MAPDL_EXEC.
255268
256269 if [[ "${MAPDL_VERSION}" == *"latest-ubuntu"* ]] ; then
@@ -276,9 +289,7 @@ jobs:
276289 $cmd ${PYTEST_INPUT_ARGUMENTS} \
277290 ${PYTEST_ARGUMENTS} \
278291 --report-log=$file_name.jsonl \
279- --cov-report=xml:$file_name.xml \
280- --log-file=pytest.log \
281- --log-file-level="DEBUG"
292+ --cov-report=xml:$file_name.xml
282293
283294 - name : " Upload pytest reports to GitHub"
284295 if : always()
@@ -295,12 +306,37 @@ jobs:
295306 run : |
296307 .ci/collect_mapdl_logs_locals.sh
297308
298- # - name: "Upload logs to GitHub"
299- # if: always()
300- # uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
301- # with:
302- # name: logs-${{ inputs.file-name }}.tgz
303- # path: ./logs-${{ inputs.file-name }}.tgz
309+ - name : " Encrypt and upload logs to GitHub"
310+ if : always() && inputs.upload-logs == true
311+ env :
312+ ENCRYPTION_KEY : ${{ secrets.log-encryption-key }}
313+ FILE_NAME : ${{ inputs.file-name }}
314+ shell : bash
315+ run : |
316+ # Check if logs exist
317+ if [ -f "./logs-${FILE_NAME}.tgz" ]; then
318+ echo "Encrypting logs..."
319+
320+ # Encrypt using OpenSSL (already available in container)
321+ openssl enc -aes-256-cbc -salt -pbkdf2 \
322+ -in ./logs-${FILE_NAME}.tgz \
323+ -out ./logs-${FILE_NAME}.tgz.enc \
324+ -pass env:ENCRYPTION_KEY
325+
326+ echo "Logs encrypted successfully"
327+ echo "To decrypt locally, use:"
328+ echo "openssl enc -aes-256-cbc -d -pbkdf2 -in logs-${FILE_NAME}.tgz.enc -out logs-${FILE_NAME}.tgz -pass pass:YOUR_KEY"
329+ else
330+ echo "No log file found to encrypt"
331+ fi
332+
333+ - name : " Upload encrypted logs to GitHub"
334+ if : always() && inputs.upload-logs == true
335+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
336+ with :
337+ name : logs-${{ inputs.file-name }}-encrypted
338+ path : ./logs-${{ inputs.file-name }}.tgz.enc
339+ retention-days : 3
304340
305341 - name : " Display files structure"
306342 if : always()
0 commit comments