Skip to content

Commit f29151f

Browse files
authored
Merge pull request #1608 from zanzaben/fix1367_add_functional_tests_to_CI
Fix #1367, Add cfe functional tests to CI
2 parents d03e24e + 4f1fe2f commit f29151f

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: "Functional Test"
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
SIMULATION: native
9+
ENABLE_UNIT_TESTS: true
10+
OMIT_DEPRECATED: true
11+
BUILDTYPE: release
12+
13+
jobs:
14+
15+
#Check for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
16+
check-for-duplicates:
17+
runs-on: ubuntu-latest
18+
# Map a step output to a job output
19+
outputs:
20+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
21+
steps:
22+
- id: skip_check
23+
uses: fkirc/skip-duplicate-actions@master
24+
with:
25+
concurrent_skipping: 'same_content'
26+
skip_after_successful_duplicate: 'true'
27+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
28+
29+
Local-Test-Build:
30+
#Continue if check-for-duplicates found no duplicates. Always runs for pull-requests.
31+
needs: check-for-duplicates
32+
if: ${{ needs.check-for-duplicates.outputs.should_skip != 'true' }}
33+
runs-on: ubuntu-18.04
34+
timeout-minutes: 15
35+
36+
steps:
37+
# Checks out a copy of your repository on the ubuntu-latest machine
38+
- name: Checkout bundle
39+
uses: actions/checkout@v2
40+
with:
41+
repository: nasa/cFS
42+
submodules: true
43+
44+
- name: Checkout submodule
45+
uses: actions/checkout@v2
46+
with:
47+
path: cfe
48+
49+
- name: Check versions
50+
run: git submodule
51+
52+
# Setup the build system
53+
- name: Set up for build
54+
run: |
55+
cp ./cfe/cmake/Makefile.sample Makefile
56+
cp -r ./cfe/cmake/sample_defs sample_defs
57+
make prep
58+
59+
# Setup the build system
60+
- name: Make Install
61+
run: make install
62+
63+
- name: List cpu1
64+
run: ls build/exe/cpu1/
65+
66+
- name: Run cFS
67+
run: |
68+
./core-cpu1 | tee cFS_startup_cpu1.txt &
69+
sleep 10
70+
../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 &
71+
72+
sleep 30
73+
counter=$(grep -c "CFE_TEST_APP" cFS_startup_cpu1.txt) &
74+
75+
while [[ -z $(grep -i "SUMMARY" cFS_startup_cpu1.txt) ]]; do
76+
echo "Waiting for CFE Tests"
77+
sleep 60
78+
79+
temp=$(grep -c "CFE_TEST_APP" cFS_startup_cpu1.txt) &
80+
81+
if [ $temp -eq $counter ]; then
82+
echo "Test is frozen. Quiting"
83+
break
84+
fi
85+
86+
counter=$(grep -c "CFE_TEST_APP" cFS_startup_cpu1.txt) &
87+
done
88+
89+
../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
90+
working-directory: ./build/exe/cpu1/
91+
92+
- name: Archive cFS Startup Artifacts
93+
uses: actions/upload-artifact@v2
94+
with:
95+
name: cFS-startup-log-deprecate-true-${{ matrix.buildtype }}
96+
path: ./build/exe/cpu1/cFS_startup_cpu1.txt
97+
98+
- name: Check for cFS Warnings
99+
run: |
100+
if [[ -z $(grep -i "SUMMARY.*FAIL::0.*TSF::0.*TTF::0" cFS_startup_cpu1.txt) ]]; then
101+
echo "Must resolve Test Failures in cFS Test App before submitting a pull request"
102+
echo ""
103+
grep -i '\[ FAIL]\|\[ TSF]\|\[ TTF]' cFS_startup_cpu1.txt
104+
exit -1
105+
fi
106+
working-directory: ./build/exe/cpu1/

0 commit comments

Comments
 (0)