-
Notifications
You must be signed in to change notification settings - Fork 51
82 lines (80 loc) · 2.34 KB
/
run-tests-reusable.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
name: Reusable testing workflow
on:
workflow_call:
inputs:
base_ref:
required: true
type: string
folder:
required: true
type: string
head_ref:
required: false
type: string
include:
required: true
type: string
repository:
required: true
type: string
jobs:
main:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
folder: ${{ fromJSON(inputs.folder) }}
os: [ubuntu-latest, windows-latest]
release: [R2023b]
include: ${{ fromJSON(inputs.include) }}
exclude:
- os: ubuntu-latest
folder: Mooring
name: "${{ matrix.folder }} - ${{ matrix.os }} - ${{ matrix.release }}"
timeout-minutes: 45
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
lfs: true
ref: ${{ inputs.head_ref }}
repository: ${{ inputs.repository }}
- name: Checkout LFS objects
run: git lfs checkout
- name: Check out WEC-Sim
uses: actions/checkout@v4
with:
repository: WEC-Sim/WEC-Sim
ref: ${{ inputs.base_ref }}
path: './WEC-Sim'
- name: Check out MoorDyn
if: matrix.folder == 'Mooring'
uses: actions/checkout@v4
with:
repository: WEC-Sim/MoorDyn
path: './MoorDyn'
- name: Copy MoorDyn Files
if: matrix.folder == 'Mooring'
run: |
cp * ../WEC-Sim/source/functions/moorDyn
ls ../WEC-Sim/source/functions/moorDyn
shell: bash
working-directory: './MoorDyn'
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
products: ${{ matrix.products }}
release: ${{ matrix.release }}
- name: Start display server (Desalination on Linux)
if: matrix.folder == 'Desalination' && matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install xvfb
Xvfb :99 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Install WEC-Sim, run tests and generate artifacts
uses: matlab-actions/run-command@v2
with:
command: |
addpath(genpath('WEC-Sim/source'));
results = wecSimAppTest("${{ matrix.folder }}"),
assertSuccess(results);