1
- name : " Deprecated Build, Test, and Run"
1
+ name : Build, Test, and Run [OMIT_DEPRECATED = false]
2
2
3
3
# Run every time a new commit pushed or for pull requests
4
4
on :
8
8
env :
9
9
SIMULATION : native
10
10
OMIT_DEPRECATED : false
11
+ ENABLE_UNIT_TESTS : true
12
+ REPO_NAME : ${{ github.event.repository.name }}
11
13
12
14
jobs :
13
15
# Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
@@ -23,15 +25,10 @@ jobs:
23
25
concurrent_skipping : ' same_content'
24
26
skip_after_successful_duplicate : ' true'
25
27
do_not_skip : ' ["pull_request", "workflow_dispatch", "schedule"]'
26
-
27
- # Set the job key. The key is displayed as the job name
28
- # when a job name is not provided
29
-
30
- build-cfs :
31
- # Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
28
+
29
+ build-cfs-omit-deprecated-false :
30
+ name : " [Deprecated] Build"
32
31
needs : check-for-duplicates
33
- if : ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
34
- name : Build
35
32
runs-on : ubuntu-18.04
36
33
37
34
strategy :
@@ -41,31 +38,39 @@ jobs:
41
38
42
39
# Set the type of machine to run on
43
40
env :
44
- BUILDTYPE : ${{ matrix.buildtype }}
41
+ BUILDTYPE : ${{ matrix.buildtype }}
45
42
46
43
steps :
47
- # Checks out a copy of your repository on the ubuntu-latest machine
48
- - name : Checkout code
44
+ - name : Cache Source and Build
45
+ id : cache-src-bld
46
+ uses : actions/cache@v2
47
+ with :
48
+ path : /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
49
+ key : deprecated-build-${{ github.run_number }}-${{ matrix.buildtype }}
50
+
51
+ - name : Checkout cFS
52
+ if : steps.cache-src-bld.outputs.cache-hit != 'true'
49
53
uses : actions/checkout@v2
50
54
with :
51
55
submodules : true
52
-
53
- # Setup the build system
54
- - name : Copy Files
56
+
57
+ - name : Check versions
58
+ run : git submodule
59
+
60
+ - name : Copy Makefile
55
61
run : |
56
62
cp ./cfe/cmake/Makefile.sample Makefile
57
63
cp -r ./cfe/cmake/sample_defs sample_defs
58
64
59
- # Setup the build system
60
- - name : Make Prep
61
- run : make prep
62
-
65
+ - name : Prep Build
66
+ run : make prep
67
+
63
68
- name : Make
64
- run : make
65
-
66
- test-cfs :
67
- name : Test
68
- needs : build-cfs
69
+ run : make install
70
+
71
+ tests-and-coverage-omit-deprecated-false :
72
+ name : " [Deprecated] Run Unit Tests and Check Coverage "
73
+ needs : build-cfs-omit-deprecated-false
69
74
runs-on : ubuntu-18.04
70
75
71
76
strategy :
@@ -78,36 +83,26 @@ jobs:
78
83
BUILDTYPE : ${{ matrix.buildtype }}
79
84
ENABLE_UNIT_TESTS : true
80
85
81
-
82
86
steps :
83
87
- name : Install Dependencies
84
88
run : sudo apt-get install lcov -y
85
-
86
- # Checks out a copy of your repository on the ubuntu-latest machine
87
- - name : Checkout code
88
- uses : actions/checkout @v2
89
+
90
+ - name : Cache Source and Deprecated Build
91
+ id : cache-src-bld
92
+ uses : actions/cache @v2
89
93
with :
90
- submodules : true
91
-
92
- # Setup the build system
93
- - name : Copy Files
94
- run : |
95
- cp ./cfe/cmake/Makefile.sample Makefile
96
- cp -r ./cfe/cmake/sample_defs sample_defs
97
-
98
- # Setup the build system
99
- - name : Make
100
- run : make
101
-
94
+ path : /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
95
+ key : deprecated-build-${{ github.run_number }}-${{ matrix.buildtype }}
96
+
102
97
- name : Run Tests
103
98
run : make test
104
99
105
100
- name : Check Coverage
106
101
run : make lcov
107
102
108
- run-cfs :
109
- name : Run
110
- needs : build-cfs
103
+ run-cfs-omit-deprecated-false :
104
+ name : " [Deprecated] Run cFS "
105
+ needs : build-cfs-omit-deprecated-false
111
106
runs-on : ubuntu-18.04
112
107
113
108
strategy :
@@ -120,21 +115,13 @@ jobs:
120
115
BUILDTYPE : ${{ matrix.buildtype }}
121
116
122
117
steps :
123
- # Checks out a copy of your repository on the ubuntu-latest machine
124
- - name : Checkout code
125
- uses : actions/checkout @v2
118
+ - name : Cache Source and Deprecated Build
119
+ id : cache-src-bld
120
+ uses : actions/cache @v2
126
121
with :
127
- submodules : true
128
-
129
- # Setup the build system
130
- - name : Copy sample_defs
131
- run : |
132
- cp ./cfe/cmake/Makefile.sample Makefile
133
- cp -r ./cfe/cmake/sample_defs sample_defs
122
+ path : /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
123
+ key : deprecated-build-${{ github.run_number }}-${{ matrix.buildtype }}
134
124
135
- # Setup the build system
136
- - name : Make Install
137
- run : make install
138
125
139
126
- name : List cpu1
140
127
run : ls build/exe/cpu1/
@@ -149,7 +136,7 @@ jobs:
149
136
- name : Archive cFS Startup Artifacts
150
137
uses : actions/upload-artifact@v2
151
138
with :
152
- name : cFS-startup-log-deprecated-false- ${{ matrix.buildtype }}
139
+ name : cFS-startup-log-omit-deprecate-false ${{ matrix.buildtype }}
153
140
path : ./build/exe/cpu1/cFS_startup_cpu1.txt
154
141
155
142
- name : Check for cFS Warnings
@@ -161,3 +148,67 @@ jobs:
161
148
exit -1
162
149
fi
163
150
working-directory : ./build/exe/cpu1/
151
+
152
+ run-functional-test-app-omit-deprecated-false :
153
+ # Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
154
+ needs : run-cfs-omit-deprecated-false
155
+ name : " [DEPRECATED] cFS Functional Tests"
156
+ runs-on : ubuntu-18.04
157
+ timeout-minutes : 15
158
+
159
+ strategy :
160
+ fail-fast : false
161
+ matrix :
162
+ buildtype : [debug, release]
163
+
164
+ steps :
165
+ - name : Cache Source and Deprecated Build
166
+ id : cache-src-bld
167
+ uses : actions/cache@v2
168
+ with :
169
+ path : /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
170
+ key : deprecated-build-${{ github.run_number }}-${{ matrix.buildtype }}
171
+
172
+ - name : List cpu1
173
+ run : ls build/exe/cpu1/
174
+
175
+ # Run cFS, send commands to set perf trigger and start perf data, and run functional tests
176
+ - name : Run cFS Functional Tests
177
+ run : |
178
+ ./core-cpu1 &
179
+ sleep 10
180
+ ../host/cmdUtil --pktid=0x1806 --cmdcode=17 --endian=LE --uint32=3 --uint32=0x40000000
181
+ ../host/cmdUtil --pktid=0x1806 --cmdcode=14 --endian=LE --uint32=2
182
+ ../host/cmdUtil --pktid=0x1806 --cmdcode=4 --endian=LE --string="20:CFE_TEST_APP" --string="20:CFE_TestMain" --string="64:cfe_testcase" --uint32=16384 --uint8=0 --uint8=0 --uint16=100
183
+ sleep 30
184
+ counter=0
185
+ while [[ ! -f cf/cfe_test.log ]]; do
186
+ temp=$(grep -c "BEGIN" cf/cfe_test.tmp)
187
+
188
+ if [ $temp -eq $counter ]; then
189
+ echo "Test is frozen. Quiting"
190
+ break
191
+ fi
192
+ counter=$(grep -c "BEGIN" cf/cfe_test.tmp)
193
+ echo "Waiting for CFE Tests"
194
+ sleep 60
195
+ done
196
+
197
+ ../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
198
+ working-directory : ./build/exe/cpu1/
199
+
200
+ - name : Archive Functional Test Artifacts
201
+ uses : actions/upload-artifact@v2
202
+ with :
203
+ name : cFS-functional-test-log-omit-deprecate-false-${{ matrix.buildtype }}
204
+ path : ./build/exe/cpu1/cf/cfe_test.log
205
+
206
+ - name : Check for cFS Warnings
207
+ run : |
208
+ if [[ -z $(grep -i "SUMMARY.*FAIL::0.*TSF::0.*TTF::0" cf/cfe_test.log) ]]; then
209
+ echo "Must resolve Test Failures in cFS Test App before submitting a pull request"
210
+ echo ""
211
+ grep -i '\[ FAIL]\|\[ TSF]\|\[ TTF]' cf/cfe_test.log
212
+ exit -1
213
+ fi
214
+ working-directory : ./build/exe/cpu1/
0 commit comments