-
Notifications
You must be signed in to change notification settings - Fork 52
29 lines (24 loc) · 1.09 KB
/
tests.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
name: Tests
on: [pull_request]
jobs:
matlab-tests:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run tests
id: matlab-test
run: |
TEST_RESULTS=$(/usr/local/bin/matlab -nodisplay -nosplash -nodesktop -r "warning('off', 'MATLAB:rmpath:DirNotFound'); rmpath(genpath('/home/m/ecModels-dependencies/RAVEN')); rmpath(genpath('/home/m/actions-runner')); addpath(genpath('.')); checkInstallation; cd('testing/unit_tests'); runtests(struct2table(dir('*.m')).name); exit;" | awk 'NR>13 && !/^(___|===|---)/')
PARSED_RESULTS="${TEST_RESULTS//'%'/'%25'}"
PARSED_RESULTS="${PARSED_RESULTS//$'\n'/'<br>'}"
PARSED_RESULTS="${PARSED_RESULTS//$'\r'/'<br>'}"
echo "results=$PARSED_RESULTS" >> $GITHUB_OUTPUT
- name: Post comment
uses: NejcZdovc/comment-pr@v2
with:
file: "commentsFromTests.md"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
TEST_RESULTS: ${{steps.matlab-test.outputs.results}}
GH_ACTION_RUN: ${{github.run_id}}