-
Notifications
You must be signed in to change notification settings - Fork 51
49 lines (47 loc) · 1.55 KB
/
all-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
name: Reusable all application test workflow
on:
workflow_call:
inputs:
client_payload:
required: true
type: string
jobs:
targets:
name: Collect folders
runs-on: ubuntu-latest
outputs:
base_ref: ${{ fromJSON(inputs.client_payload).branch }}
folder: ${{ steps.output.outputs.folder }}
head_ref: ${{ fromJSON(inputs.client_payload).branch }}
include: ${{ steps.output.outputs.include }}
repository: ${{ github.repository }}
steps:
- run: echo "Triggered by WEC-Sim commit ${{ fromJSON(inputs.client_payload).sha }}"
- name: Check out repository
uses: actions/checkout@v4
with:
lfs: true
ref: ${{ fromJSON(inputs.client_payload).branch }}
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2024a
- name: Get test target folder
uses: matlab-actions/run-command@v2
with:
command: getTestTargets
- name: Save output
id: output
run: |
echo "folder=$(cat folder.json | jq -cr)" >> $GITHUB_OUTPUT
echo "include=$(cat include.json | jq -cr)" >> $GITHUB_OUTPUT
run_tests:
name: Run tests
needs: targets
uses: ./.github/workflows/run-tests-reusable.yml
with:
base_ref: ${{ needs.targets.outputs.base_ref }}
folder: ${{ needs.targets.outputs.folder }}
head_ref: ${{ needs.targets.outputs.head_ref }}
include: ${{ needs.targets.outputs.include }}
repository: ${{ needs.targets.outputs.repository }}