Skip to content

Commit 8a0489f

Browse files
committed
Fix #161, Github actions workflow for CI (#159)
Create three separate workflows. The build-cfs and build-cfs-deprecated workflows differ only by the OMIT_DEPRECATED flag status. The build-documentation workflow only builds the doxygen docs.
1 parent 9794a70 commit 8a0489f

File tree

3 files changed

+447
-0
lines changed

3 files changed

+447
-0
lines changed
+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: "Deprecated Build, Test, and Run"
2+
3+
# Run this workflow every time a new commit pushed to your repository
4+
on: push
5+
6+
env:
7+
SIMULATION: native
8+
ENABLE_UNIT_TESTS: true
9+
OMIT_DEPRECATED: false
10+
11+
jobs:
12+
13+
# Set the job key. The key is displayed as the job name
14+
# when a job name is not provided
15+
16+
build-cfs:
17+
name: Build
18+
runs-on: ubuntu-18.04
19+
20+
strategy:
21+
matrix:
22+
buildtype: [debug, release]
23+
24+
# Set the type of machine to run on
25+
env:
26+
BUILDTYPE: ${{ matrix.buildtype }}
27+
28+
steps:
29+
# Checks out a copy of your repository on the ubuntu-latest machine
30+
- name: Checkout code
31+
uses: actions/checkout@v2
32+
with:
33+
submodules: true
34+
35+
# Setup the build system
36+
- name: Copy Files
37+
run: |
38+
cp ./cfe/cmake/Makefile.sample Makefile
39+
cp -r ./cfe/cmake/sample_defs sample_defs
40+
41+
# Setup the build system
42+
- name: Make Prep
43+
run: make prep
44+
45+
- name: Make
46+
run: make
47+
48+
test-cfs:
49+
name: Test
50+
needs: build-cfs
51+
runs-on: ubuntu-18.04
52+
53+
strategy:
54+
matrix:
55+
buildtype: [debug, release]
56+
57+
# Set the type of machine to run on
58+
env:
59+
BUILDTYPE: ${{ matrix.buildtype }}
60+
61+
steps:
62+
- name: Install Dependencies
63+
run: sudo apt-get install lcov -y
64+
65+
# Checks out a copy of your repository on the ubuntu-latest machine
66+
- name: Checkout code
67+
uses: actions/checkout@v2
68+
with:
69+
submodules: true
70+
71+
# Setup the build system
72+
- name: Copy Files
73+
run: |
74+
cp ./cfe/cmake/Makefile.sample Makefile
75+
cp -r ./cfe/cmake/sample_defs sample_defs
76+
77+
# Setup the build system
78+
- name: Make
79+
run: make
80+
81+
- name: Run Tests
82+
run: make test
83+
84+
- name: Check Coverage
85+
run: make lcov
86+
87+
run-cfs:
88+
name: Run
89+
needs: build-cfs
90+
runs-on: ubuntu-18.04
91+
92+
strategy:
93+
matrix:
94+
buildtype: [debug, release]
95+
96+
# Set the type of machine to run on
97+
env:
98+
BUILDTYPE: ${{ matrix.buildtype }}
99+
100+
steps:
101+
# Checks out a copy of your repository on the ubuntu-latest machine
102+
- name: Checkout code
103+
uses: actions/checkout@v2
104+
with:
105+
submodules: true
106+
107+
# Setup the build system
108+
- name: Copy sample_defs
109+
run: |
110+
cp ./cfe/cmake/Makefile.sample Makefile
111+
cp -r ./cfe/cmake/sample_defs sample_defs
112+
113+
# Setup the build system
114+
- name: Make Install
115+
run: make install
116+
117+
- name: List cpu1
118+
run: ls build/exe/cpu1/
119+
120+
- name: Run cFS
121+
run: |
122+
./core-cpu1 > cFS_startup_cpu1.txt &
123+
sleep 30
124+
../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
125+
working-directory: ./build/exe/cpu1/
126+
127+
- name: Archive cFS Startup Artifacts
128+
uses: actions/upload-artifact@v2
129+
with:
130+
name: cFS-startup-log-deprecated-false-${{ matrix.buildtype }}
131+
path: ./build/exe/cpu1/cFS_startup_cpu1.txt
132+
133+
- name: Check for cFS Warnings
134+
run: |
135+
if [[ -n $(grep -i "warn\|err\|fail" cFS_startup_cpu1.txt) ]]; then
136+
echo "Must resolve warn|err|fail in cFS startup before submitting a pull request"
137+
echo ""
138+
grep -i 'warn\|err\|fail' cFS_startup_cpu1.txt
139+
exit -1
140+
fi
141+
working-directory: ./build/exe/cpu1/

.github/workflows/build-cfs.yml

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Build, Test, and Run [OMIT_DEPRECATED=true]
2+
3+
# Run this workflow every time a new commit pushed to your repository
4+
on: push
5+
6+
env:
7+
SIMULATION: native
8+
ENABLE_UNIT_TESTS: true
9+
OMIT_DEPRECATED: true
10+
11+
jobs:
12+
13+
# Set the job key. The key is displayed as the job name
14+
# when a job name is not provided
15+
16+
build-cfs:
17+
name: Build
18+
runs-on: ubuntu-18.04
19+
20+
strategy:
21+
matrix:
22+
buildtype: [debug, release]
23+
24+
# Set the type of machine to run on
25+
env:
26+
BUILDTYPE: ${{ matrix.buildtype }}
27+
28+
steps:
29+
# Checks out a copy of your repository on the ubuntu-latest machine
30+
- name: Checkout code
31+
uses: actions/checkout@v2
32+
with:
33+
submodules: true
34+
35+
# Setup the build system
36+
- name: Copy Files
37+
run: |
38+
cp ./cfe/cmake/Makefile.sample Makefile
39+
cp -r ./cfe/cmake/sample_defs sample_defs
40+
41+
# Setup the build system
42+
- name: Make Prep
43+
run: make prep
44+
45+
- name: Make
46+
run: make
47+
48+
test-cfs:
49+
name: Test
50+
needs: build-cfs
51+
runs-on: ubuntu-18.04
52+
53+
strategy:
54+
matrix:
55+
buildtype: [debug, release]
56+
57+
# Set the type of machine to run on
58+
env:
59+
BUILDTYPE: ${{ matrix.buildtype }}
60+
61+
steps:
62+
- name: Install Dependencies
63+
run: sudo apt-get install lcov -y
64+
65+
# Checks out a copy of your repository on the ubuntu-latest machine
66+
- name: Checkout code
67+
uses: actions/checkout@v2
68+
with:
69+
submodules: true
70+
71+
# Setup the build system
72+
- name: Copy Files
73+
run: |
74+
cp ./cfe/cmake/Makefile.sample Makefile
75+
cp -r ./cfe/cmake/sample_defs sample_defs
76+
77+
# Setup the build system
78+
- name: Make
79+
run: make
80+
81+
- name: Run Tests
82+
run: make test
83+
84+
- name: Check Coverage
85+
run: make lcov
86+
87+
run-cfs:
88+
name: Run
89+
needs: build-cfs
90+
runs-on: ubuntu-18.04
91+
92+
strategy:
93+
matrix:
94+
buildtype: [debug, release]
95+
96+
# Set the type of machine to run on
97+
env:
98+
BUILDTYPE: ${{ matrix.buildtype }}
99+
100+
steps:
101+
# Checks out a copy of your repository on the ubuntu-latest machine
102+
- name: Checkout code
103+
uses: actions/checkout@v2
104+
with:
105+
submodules: true
106+
107+
# Setup the build system
108+
- name: Copy sample_defs
109+
run: |
110+
cp ./cfe/cmake/Makefile.sample Makefile
111+
cp -r ./cfe/cmake/sample_defs sample_defs
112+
113+
# Setup the build system
114+
- name: Make Install
115+
run: make install
116+
117+
- name: List cpu1
118+
run: ls build/exe/cpu1/
119+
120+
- name: Run cFS
121+
run: |
122+
./core-cpu1 > cFS_startup_cpu1.txt &
123+
sleep 30
124+
../host/cmdUtil --endian=LE --pktid=0x1806 --cmdcode=2 --half=0x0002
125+
working-directory: ./build/exe/cpu1/
126+
127+
- name: Archive cFS Startup Artifacts
128+
uses: actions/upload-artifact@v2
129+
with:
130+
name: cFS-startup-log-deprecate-true-${{ matrix.buildtype }}
131+
path: ./build/exe/cpu1/cFS_startup_cpu1.txt
132+
133+
- name: Check for cFS Warnings
134+
run: |
135+
if [[ -n $(grep -i "warn\|err\|fail" cFS_startup_cpu1.txt) ]]; then
136+
echo "Must resolve warn|err|fail in cFS startup before submitting a pull request"
137+
echo ""
138+
grep -i 'warn\|err\|fail' cFS_startup_cpu1.txt
139+
exit -1
140+
fi
141+
working-directory: ./build/exe/cpu1/

0 commit comments

Comments
 (0)