Skip to content

Commit ed26455

Browse files
authored
Merge pull request #359 from nasa/integration-candidate
cFS Bundle Integration candidate: 2021-09-21
2 parents 69572b0 + 0965326 commit ed26455

File tree

9 files changed

+223
-121
lines changed

9 files changed

+223
-121
lines changed
+109-58
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Deprecated Build, Test, and Run"
1+
name: Build, Test, and Run [OMIT_DEPRECATED = false]
22

33
# Run every time a new commit pushed or for pull requests
44
on:
@@ -8,6 +8,8 @@ on:
88
env:
99
SIMULATION: native
1010
OMIT_DEPRECATED: false
11+
ENABLE_UNIT_TESTS: true
12+
REPO_NAME: ${{ github.event.repository.name }}
1113

1214
jobs:
1315
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
@@ -23,15 +25,10 @@ jobs:
2325
concurrent_skipping: 'same_content'
2426
skip_after_successful_duplicate: 'true'
2527
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"
3231
needs: check-for-duplicates
33-
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
34-
name: Build
3532
runs-on: ubuntu-18.04
3633

3734
strategy:
@@ -41,31 +38,39 @@ jobs:
4138

4239
# Set the type of machine to run on
4340
env:
44-
BUILDTYPE: ${{ matrix.buildtype }}
41+
BUILDTYPE: ${{ matrix.buildtype }}
4542

4643
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'
4953
uses: actions/checkout@v2
5054
with:
5155
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
5561
run: |
5662
cp ./cfe/cmake/Makefile.sample Makefile
5763
cp -r ./cfe/cmake/sample_defs sample_defs
5864
59-
# Setup the build system
60-
- name: Make Prep
61-
run: make prep
62-
65+
- name: Prep Build
66+
run: make prep
67+
6368
- 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
6974
runs-on: ubuntu-18.04
7075

7176
strategy:
@@ -78,36 +83,26 @@ jobs:
7883
BUILDTYPE: ${{ matrix.buildtype }}
7984
ENABLE_UNIT_TESTS: true
8085

81-
8286
steps:
8387
- name: Install Dependencies
8488
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
8993
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+
10297
- name: Run Tests
10398
run: make test
10499

105100
- name: Check Coverage
106101
run: make lcov
107102

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
111106
runs-on: ubuntu-18.04
112107

113108
strategy:
@@ -120,21 +115,13 @@ jobs:
120115
BUILDTYPE: ${{ matrix.buildtype }}
121116

122117
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
126121
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 }}
134124

135-
# Setup the build system
136-
- name: Make Install
137-
run: make install
138125

139126
- name: List cpu1
140127
run: ls build/exe/cpu1/
@@ -149,7 +136,7 @@ jobs:
149136
- name: Archive cFS Startup Artifacts
150137
uses: actions/upload-artifact@v2
151138
with:
152-
name: cFS-startup-log-deprecated-false-${{ matrix.buildtype }}
139+
name: cFS-startup-log-omit-deprecate-false${{ matrix.buildtype }}
153140
path: ./build/exe/cpu1/cFS_startup_cpu1.txt
154141

155142
- name: Check for cFS Warnings
@@ -161,3 +148,67 @@ jobs:
161148
exit -1
162149
fi
163150
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

Comments
 (0)