Skip to content

Commit 3b47087

Browse files
committed
ci: add GitHub Actions workflow and update README badges
- Add comprehensive CI/CD workflow with multi-OS testing - Update README to use GitHub Actions badge instead of broken Travis CI - Add professional issue templates and PR template for better contribution workflow - Use official femu-compile.sh build process in CI pipeline - Include FEMU device registration and multi-mode testing verification
1 parent 9fdaaa2 commit 3b47087

5 files changed

Lines changed: 246 additions & 2 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in FEMU
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**Environment**
14+
- Host OS: [e.g. Ubuntu 22.04]
15+
- Kernel version: [e.g. 5.15.0]
16+
- FEMU version/commit: [e.g. v10.1 or commit hash]
17+
- FEMU mode: [BlackBox/WhiteBox/ZNS/NoSSD]
18+
19+
**To Reproduce**
20+
Steps to reproduce the behavior:
21+
1. Configure FEMU with '...'
22+
2. Run command '...'
23+
3. See error
24+
25+
**Expected behavior**
26+
A clear and concise description of what you expected to happen.
27+
28+
**Error logs**
29+
If applicable, add error logs or screenshots to help explain your problem.
30+
31+
**Additional context**
32+
Add any other context about the problem here (VM configuration, guest OS, etc.).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature for FEMU
4+
title: "[FEATURE] "
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Use case**
20+
Describe the research or development use case for this feature.
21+
22+
**Additional context**
23+
Add any other context, mockups, or references about the feature request here.

.github/pull_request_template.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Description
2+
Brief description of changes made.
3+
4+
## Type of Change
5+
- [ ] Bug fix (non-breaking change which fixes an issue)
6+
- [ ] New feature (non-breaking change which adds functionality)
7+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8+
- [ ] Documentation update
9+
- [ ] Performance improvement
10+
- [ ] Code refactoring
11+
12+
## Testing
13+
- [ ] I have tested my changes locally
14+
- [ ] I have added tests that prove my fix is effective or that my feature works
15+
- [ ] All existing tests pass
16+
- [ ] I have tested across multiple FEMU modes (if applicable)
17+
18+
## FEMU Modes Tested
19+
- [ ] BlackBox SSD (BBSSD)
20+
- [ ] WhiteBox SSD (OCSSD)
21+
- [ ] Zoned Namespace SSD (ZNSSD)
22+
- [ ] NoSSD
23+
- [ ] Not applicable
24+
25+
## Platform Testing
26+
- [ ] Ubuntu 20.04/22.04
27+
- [ ] Other distributions (specify): ___________
28+
- [ ] Build verification completed
29+
30+
## Checklist
31+
- [ ] My code follows QEMU coding standards
32+
- [ ] I have commented my code, particularly in hard-to-understand areas
33+
- [ ] My changes generate no new compiler warnings
34+
- [ ] I have updated documentation if necessary
35+
- [ ] No trailing whitespace or C++ style comments in C files
36+
37+
## Related Issues
38+
Fixes #(issue number)
39+
40+
## Additional Notes
41+
Any additional information, configuration changes, or notes for reviewers.

.github/workflows/ci.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
os: [ubuntu-20.04, ubuntu-22.04]
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Install dependencies
23+
run: |
24+
sudo apt update
25+
sudo apt install -y build-essential pkg-config libglib2.0-dev \
26+
libpixman-1-dev libfdt-dev zlib1g-dev libaio-dev \
27+
libcap-ng-dev libattr1-dev ninja-build python3-pip \
28+
libslirp-dev libseccomp-dev libcurl4-gnutls-dev \
29+
libiscsi-dev libnfs-dev librbd-dev librados-dev \
30+
libssh-dev liblzo2-dev libsnappy-dev libbz2-dev \
31+
liblzma-dev libzstd-dev libgcrypt20-dev libgnutls28-dev \
32+
uuid-dev libcap-dev libxml2-dev libmount-dev \
33+
liburing-dev flex bison
34+
35+
- name: Setup FEMU build environment
36+
run: |
37+
mkdir build-femu
38+
cd build-femu
39+
cp ../femu-scripts/femu-copy-scripts.sh .
40+
./femu-copy-scripts.sh .
41+
42+
- name: Build FEMU using official script
43+
run: |
44+
cd build-femu
45+
./femu-compile.sh
46+
47+
- name: Verify FEMU device registration
48+
run: |
49+
cd build-femu
50+
./qemu-system-x86_64 -device help | grep -q "femu" || exit 1
51+
echo "✓ FEMU device successfully registered"
52+
53+
- name: Run basic functionality test
54+
run: |
55+
cd build-femu
56+
timeout 10s ./qemu-system-x86_64 -device femu,help || true
57+
echo "✓ FEMU device parameters accessible"
58+
59+
- name: Check FEMU modes
60+
run: |
61+
cd build-femu
62+
# Verify all major FEMU modes can be instantiated
63+
for mode in 0 1 2 3; do
64+
timeout 5s ./qemu-system-x86_64 \
65+
-device femu,devsz_mb=1024,femu_mode=${mode},serial=test${mode} \
66+
-nographic -M accel=qtest || true
67+
echo "✓ FEMU mode ${mode} instantiation test completed"
68+
done
69+
70+
- name: Archive build artifacts
71+
uses: actions/upload-artifact@v4
72+
if: success()
73+
with:
74+
name: femu-binary-${{ matrix.os }}
75+
path: |
76+
build-femu/qemu-system-x86_64
77+
build-femu/config-host.mak
78+
build-femu/run-*.sh
79+
retention-days: 7
80+
81+
compatibility-test:
82+
runs-on: ubuntu-latest
83+
needs: build
84+
if: success()
85+
86+
steps:
87+
- name: Checkout code
88+
uses: actions/checkout@v4
89+
90+
- name: Download build artifacts
91+
uses: actions/download-artifact@v4
92+
with:
93+
name: femu-binary-ubuntu-22.04
94+
path: build-femu/
95+
96+
- name: Make binary executable
97+
run: chmod +x build-femu/qemu-system-x86_64
98+
99+
- name: Test run scripts syntax
100+
run: |
101+
cd build-femu
102+
# Check syntax of run scripts (already copied by build job)
103+
for script in run-*.sh; do
104+
bash -n "$script"
105+
echo "✓ $script syntax check passed"
106+
done
107+
108+
- name: Validate FEMU configuration parameters
109+
run: |
110+
cd build-femu
111+
# Test different SSD configurations
112+
./qemu-system-x86_64 \
113+
-device femu,devsz_mb=2048,secsz=512,secs_per_pg=8,pgs_per_blk=256 \
114+
-M accel=qtest -nographic &
115+
sleep 2
116+
kill %1 2>/dev/null || true
117+
echo "✓ FEMU SSD parameter validation completed"
118+
119+
code-quality:
120+
runs-on: ubuntu-latest
121+
122+
steps:
123+
- name: Checkout code
124+
uses: actions/checkout@v4
125+
126+
- name: Check code style
127+
run: |
128+
# Check for trailing whitespace in FEMU source files
129+
! find hw/femu -name "*.c" -o -name "*.h" | xargs grep -l '[[:space:]]$'
130+
echo "✓ No trailing whitespace found"
131+
132+
# Check for C++ style comments in C files
133+
! find hw/femu -name "*.c" -o -name "*.h" | xargs grep '//'
134+
echo "✓ No C++ style comments found in C files"
135+
136+
- name: Check build system consistency
137+
run: |
138+
# Verify FEMU is properly integrated in build system
139+
grep -q "CONFIG_FEMU_PCI" hw/femu/Kconfig
140+
grep -q "source femu/Kconfig" hw/Kconfig
141+
echo "✓ Build system integration verified"
142+
143+
- name: Validate documentation
144+
run: |
145+
# Check that README references are valid
146+
[ -f "README.md" ] && echo "✓ README.md exists"
147+
[ -d "hw/femu" ] && echo "✓ FEMU source directory exists"
148+
[ -f "hw/femu/meson.build" ] && echo "✓ FEMU meson.build exists"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[![FEMU Version](https://img.shields.io/badge/FEMU-v9.0-brightgreen)](https://img.shields.io/badge/FEMU-v9.0-brightgreen)
2-
[![Build Status](https://travis-ci.com/MoatLab/FEMU.svg?branch=master)](https://travis-ci.com/MoatLab/FEMU)
1+
[![FEMU Version](https://img.shields.io/badge/FEMU-v10.1-brightgreen)](https://img.shields.io/badge/FEMU-v10.1-brightgreen)
2+
[![Build Status](https://github.com/MoatLab/FEMU/workflows/CI/badge.svg)](https://github.com/MoatLab/FEMU/actions)
33
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
44
[![Platform](https://img.shields.io/badge/Platform-x86--64-brightgreen)](https://shields.io/)
55

0 commit comments

Comments
 (0)