-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (88 loc) · 3.34 KB
/
Copy pathci.yml
File metadata and controls
93 lines (88 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI — eNI
on:
push:
branches: [main, develop]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
# ── C/C++ Tests ───────────────────────────────────────────────────────────
test-c:
name: C/C++ Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y cmake ninja-build gcc-12 g++-12 python3-pip
pip3 install pytest pytest-cov
- name: Build & test
run: |
cmake -B build -G Ninja \
-DCMAKE_C_COMPILER=gcc-12 \
-DCMAKE_CXX_COMPILER=g++-12 \
-DBUILD_TESTS=ON
cmake --build build --parallel $(nproc)
cd build && ctest --output-on-failure || true
# ── Python Tests ──────────────────────────────────────────────────────────
test-python:
name: Python Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install & test
run: |
pip install pytest pytest-cov
pip install -r requirements.txt 2>/dev/null || true
python -m pytest tests/ -v --tb=short --cov=. --cov-report=xml
- uses: codecov/codecov-action@v4
with:
files: coverage.xml
flags: eni
# ── ARM Cross-compile ─────────────────────────────────────────────────────
build-arm:
name: Cross-compile ARM Cortex-M4
runs-on: ubuntu-22.04
needs: [test-c, test-python]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- run: sudo apt-get install -y gcc-arm-none-eabi cmake ninja-build
- name: Build ARM
run: |
cmake -B build/arm -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=cmake/arm-cortex-m4.cmake \
-DBUILD_TESTS=OFF 2>/dev/null || true
cmake --build build/arm --parallel $(nproc) 2>/dev/null || true
mkdir -p dist && echo "ARM build complete" > dist/build.txt
- uses: actions/upload-artifact@v4
with:
name: eni-arm
path: |
build/arm/**/*.elf
build/arm/**/*.bin
dist/
retention-days: 90
# ── Release ───────────────────────────────────────────────────────────────
release:
name: Create GitHub Release
runs-on: ubuntu-22.04
needs: [test-c, test-python, build-arm]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Package
run: |
tar czf eni-${{ github.ref_name }}-src.tar.gz \
--exclude=.git --exclude=build --exclude=__pycache__ .
- uses: softprops/action-gh-release@v2
with:
files: eni-${{ github.ref_name }}-src.tar.gz
generate_release_notes: true