-
Notifications
You must be signed in to change notification settings - Fork 5
169 lines (147 loc) · 5.55 KB
/
PNDDemo.yaml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: PNDDemo_Workflow
on:
pull_request:
permissions:
checks: write
contents: read
jobs:
# Job to build the System Under Test (SUT)
build-sut:
name: Build SUT
runs-on: vtt
steps:
# check out the repository containing the codebase
- name: Checkout repository
uses: actions/checkout@v4
# run DaVinci & vVIRTUALtarget if no cache build is available
- name: Run DaVinci & vVIRTUALtarget
run: |
VttMake make ./ECU/LightControl.vttmake;
if(-Not $?)
{
Write-Host "VttMake step failed." -ForegroundColor red
Exit -1
}
# upload the SUT directory as an artifact for use in other jobs
- name: Export ECU/SUT
uses: actions/upload-artifact@v4
with:
name: SUT
path: ./ECU/SUT
retention-days: 7
# list the contents of the SUT directory to verify the build
- name: Check DLL
run : ls ECU/SUT/
# Job to build the simulation environment and compile test units
build-simulation:
name: Build simulation
needs: [build-sut]
runs-on: canoe-small
steps:
# check out the repository containing the codebase
- name: Checkout repository
uses: actions/checkout@v4
# download the SUT artifact produced by the build-sut job
- name: Fetch SUT artifact
uses: actions/download-artifact@v4
with:
name: SUT
path: ECU/SUT
# create the simulation environment from the venvironment.yaml file
- name: Make environment
run: |
environment-make -o ./compiled-environment-and-tests -A Win32 ./environment-make/venvironment.yaml;
# compile the test units for the environment
- name: Make test units
run: |
test-unit-make -e ./compiled-environment-and-tests/Default.venvironment -o ./compiled-environment-and-tests/ ./tests/auto/auto.vtestunit.yaml ./tests/basic/basic.vtestunit.yaml;
# upload the compiled environment and test units as an artifact
- name: Export compiled-environment-and-tests
uses: actions/upload-artifact@v4
with:
name: compiled-environment-and-tests
path: ./compiled-environment-and-tests/
retention-days: 7
# Job to run the simulation tests
run-tests-simulation:
name: Run simulation
needs: build-simulation
runs-on: canoe-large
strategy:
matrix:
TESTNAME: [auto, basic]
fail-fast: false
steps:
# check out the repository containing the codebase
- name: Checkout repository
uses: actions/checkout@v4
# download the SUT artifact produced by the build-sut job
- name: Fetch SUT artifact
uses: actions/download-artifact@v4
with:
name: SUT
path: ECU/SUT
# download the compiled environment and tests artifact produced by the build-simulation job
- name: Fetch compiled-environment-and-tests artifact
uses: actions/download-artifact@v4
with:
name: compiled-environment-and-tests
path: compiled-environment-and-tests
# run the CANoe4SW Server Edition with the specified test unit
- name: Run CANoe4SW Server Edition
id: canoe4swse
run: |
& canoe4sw-se ./compiled-environment-and-tests/Default.venvironment -d ./simulation --win32 --port-rtk-api none --test-unit ./compiled-environment-and-tests/${{ matrix.TESTNAME }}.vtestunit;
Write-Host "CANoe4SW Server Edition returned exit code $LASTEXITCODE"
# upload the test reports generated by the simulation
- name: Export test reports
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: Test Reports ${{ matrix.TESTNAME }}
path: |
./simulation/TestReports/
retention-days: 7
# upload the log files generated by the simulation
- name: Upload log files
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: Log Files ${{ matrix.TESTNAME }}
path: ./simulation/*.txt
# Job to display the test report
display-test-report:
name: Display test report
if: ${{ !cancelled() }}
needs: run-tests-simulation
runs-on: canoe-small
steps:
# check out the repository containing the codebase
- name: Checkout repository
uses: actions/checkout@v4
# download the test report artifact for the 'auto' test
- name: Fetch testreport auto artifact
uses: actions/download-artifact@v4
with:
name: Test Reports auto
path: ./simulation/TestReports/
# download the test report artifact for the 'basic' test
- name: Fetch testreport basic artifact
uses: actions/download-artifact@v4
with:
name: Test Reports basic
path: ./simulation/TestReports/
# convert all test reports to XUnit format
- name: Convert all test reports to XUnit format
working-directory: ./simulation/TestReports/
run: |
get-childitem . -Filter *.vtestreport | foreach {
ReportViewerCli -r $_ -xu
}
# display the test results using the dorny/test-reporter action
- name: Display test results
uses: dorny/[email protected]
with:
name: Test results # Name of the check run which will be created
path: "./simulation/TestReports/*_xunit.xml" # Path to test results
reporter: java-junit # Format of test results