Skip to content

Commit 04c885f

Browse files
committed
Part cFS/workflows#122, Add Internal Workflows
1 parent 256bc4d commit 04c885f

4 files changed

Lines changed: 454 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Add Issue or PR to Project
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request_target:
7+
types: [opened, ready_for_review, converted_to_draft]
8+
9+
jobs:
10+
add-to-project:
11+
name: Add issue or pull request to project
12+
uses: nasa/cFS/.github/workflows/add-to-project-reusable.yml@dev
13+
secrets: inherit
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Code Coverage Analysis, EDS enabled"
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
pull_request:
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
workflow_dispatch:
14+
schedule:
15+
# 11:00 PM UTC every Sunday
16+
- cron: '0 23 * * 0'
17+
18+
env:
19+
SIMULATION: native
20+
ENABLE_UNIT_TESTS: true
21+
OMIT_DEPRECATED: false
22+
CFE_EDS_ENABLED: true
23+
BUILDTYPE: debug
24+
25+
jobs:
26+
27+
Execute-Unit-Tests:
28+
name: Build and Execute CFE unit tests
29+
runs-on: ubuntu-22.04
30+
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest
31+
timeout-minutes: 15
32+
33+
steps:
34+
- name: Checkout CFE
35+
uses: actions/checkout@v4
36+
with:
37+
path: cfe
38+
39+
- name: Set up Dependencies
40+
uses: ./cfe/.github/actions/setup-cfe
41+
with:
42+
source-dir: .
43+
preferred-ref: ${{ github.head_ref }}
44+
org: nasa
45+
46+
- name: Execute coverage testing
47+
uses: ./cfe/.github/actions/code-coverage
48+
with:
49+
module-list: config core_api core_private es evs fs resourceid sb sbr tbl time
50+
allowed-missed-branches: 22
51+
allowed-missed-lines: 14
52+
allowed-missed-functions: 0
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
name: "Functional Test, EDS enabled"
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
pull_request:
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
workflow_dispatch:
14+
schedule:
15+
# 11:45 PM UTC every Sunday
16+
- cron: '45 23 * * 0'
17+
18+
env:
19+
SIMULATION: native
20+
ENABLE_UNIT_TESTS: false
21+
OMIT_DEPRECATED: true
22+
CFE_EDS_ENABLED: true
23+
BUILDTYPE: debug
24+
# jphfix should be release
25+
26+
jobs:
27+
28+
Local-Test-Build:
29+
name: Build CFE
30+
runs-on: ubuntu-22.04
31+
container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest
32+
timeout-minutes: 15
33+
34+
steps:
35+
- name: Checkout CFE
36+
uses: actions/checkout@v4
37+
with:
38+
path: cfe
39+
40+
- name: Set up Dependencies
41+
uses: ./cfe/.github/actions/setup-cfe
42+
with:
43+
source-dir: .
44+
preferred-ref: ${{ github.head_ref }}
45+
org: nasa
46+
47+
# Setup the build system
48+
- name: Set up for build
49+
run: make prep
50+
51+
- name: Build CFE
52+
run: make install
53+
54+
- name: Generate Startup Link
55+
run: ln -s core-cpu1 ./build/exe/cpu1/container-start
56+
57+
- name: List cpu1
58+
run: ls build/exe/cpu1/
59+
60+
- name: Archive binaries
61+
run: |
62+
cd $GITHUB_WORKSPACE/build/exe
63+
find -maxdepth 1 -mindepth 1 -type d | while read dir
64+
do
65+
inst=$(basename ${dir})
66+
tar Jcv -f $GITHUB_WORKSPACE/${inst}-bin.tar.xz -C ${inst} .
67+
done
68+
- name: Upload all artifacts
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: functional-test-eds-bin
72+
path: ./*.tar.xz
73+
74+
Execute-Test:
75+
name: Execute Functional Test
76+
permissions:
77+
contents: read
78+
actions: read
79+
env:
80+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
GH_HOST: developer.nasa.gov
82+
GH_REPO: cFS/cFE
83+
runs-on: ubuntu-22.04
84+
needs: Local-Test-Build
85+
timeout-minutes: 15
86+
87+
steps:
88+
- name: Download artifact
89+
uses: actions/download-artifact@v4
90+
with:
91+
name: functional-test-eds-bin
92+
path: functional-test-eds-bin
93+
94+
- name: Unpack artifacts
95+
run: |
96+
for i in cpu1 host
97+
do
98+
mkdir -p "$i"
99+
tar Jxv -C "$i" -f "$GITHUB_WORKSPACE/functional-test-eds-bin/$i-bin.tar.xz"
100+
done
101+
- name: List Files
102+
run: ls -lR .
103+
104+
- name: Start CPU1 container
105+
id: start-cpu1
106+
uses: nasa/cFS/actions/start-cfs-container@dev
107+
with:
108+
binary-dir: ${{ github.workspace }}/cpu1
109+
exec-image: ghcr.io/core-flight-system/cfsbuildenv-linux:latest
110+
111+
- name: Check CPU1 container
112+
id: check-cpu1
113+
uses: nasa/cFS/actions/healthcheck-logs@dev
114+
with:
115+
container-id: ${{ steps.start-cpu1.outputs.container-id }}
116+
healthcheck-regex: 'CFE_ES_Main entering OPERATIONAL state$'
117+
118+
- name: Execute No-Op Check
119+
working-directory: ./host
120+
run: |
121+
./cmd_send -v --host=${{ steps.check-cpu1.outputs.ip-addr }} --endian=EDS --pktid=CFE_ES/Application/CMD --cmdcode=NoopCmd
122+
sleep 2
123+
docker logs "${{ steps.start-cpu1.outputs.container-id }}" | grep -A 2 'CFE_ES 3: No-op command'
124+
- name: Launch Functional Test
125+
working-directory: ./host
126+
run: |
127+
./cmd_send -v --host=${{ steps.check-cpu1.outputs.ip-addr }} --endian=EDS --pktid=CFE_ES/Application/CMD --cmdcode=StartAppCmd Application="CFE_TEST" AppEntryPoint="CFE_TestMain" AppFileName="cfe_testcase" StackSize=16384 Priority=100
128+
sleep 10
129+
docker logs "${{ steps.start-cpu1.outputs.container-id }}"
130+
- name: Wait for Functional Test
131+
working-directory: ./cpu1
132+
run: |
133+
counter=0
134+
stuck=0
135+
while [ ! -f cf/cfe_test.log ]
136+
do
137+
temp=$(grep -c "BEGIN" cf/cfe_test.tmp)
138+
if [ $temp -eq $counter ]
139+
then
140+
stuck=$(($stuck + 1))
141+
else
142+
stuck=0
143+
fi
144+
if [ $stuck -ge 3 ]
145+
then
146+
echo "Test is frozen. Quitting"
147+
break
148+
fi
149+
counter=$(grep -c "BEGIN" cf/cfe_test.tmp)
150+
echo "Waiting for CFE Tests"
151+
sleep 30
152+
done
153+
154+
- name: Shut down CFE
155+
if: ${{ always() && steps.check-cpu1.outputs.ip-addr != '' }}
156+
working-directory: ./host
157+
run: |
158+
./cmd_send -v --host=${{ steps.check-cpu1.outputs.ip-addr }} --endian=EDS --pktid=CFE_ES/Application/CMD --cmdcode=RestartCmd RestartType=2
159+
sleep 1
160+
161+
- name: Stop CPU1 Container
162+
if: ${{ always() && steps.start-cpu1.outputs.container-id != '' }}
163+
uses: nasa/cFS/actions/stop-cfs-container@dev
164+
with:
165+
container-id: ${{ steps.start-cpu1.outputs.container-id }}
166+
167+
- name: Archive cFS Startup Artifacts
168+
if: always()
169+
uses: actions/upload-artifact@v4
170+
with:
171+
name: cFS-startup-log-deprecate-true-release
172+
path: cpu1/cf/cfe_test.log
173+
174+
- name: Check for cFS Warnings
175+
run: |
176+
if [[ -z $(grep -i "SUMMARY.*FAIL::0.*TSF::0.*TTF::0" cf/cfe_test.log) ]]; then
177+
echo "Must resolve Test Failures in cFS Test App before submitting a pull request"
178+
echo ""
179+
grep -i '\[ FAIL]\|\[ TSF]\|\[ TTF]' cf/cfe_test.log
180+
exit -1
181+
fi
182+
working-directory: ./cpu1/

0 commit comments

Comments
 (0)