Skip to content

Commit 0a34caf

Browse files
authored
Merge branch 'main' into feature/Aaron/CPUMonitor
2 parents 280b2f9 + 278de2b commit 0a34caf

115 files changed

Lines changed: 14946 additions & 474 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @RIT-Launch-Initiative/avionics-software
2+

.github/actions/fsw-setup/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ description: |
44
runs:
55
using: "composite"
66
steps:
7+
- name: Add 32bit
8+
if: runner.os == 'Linux'
9+
shell: bash
10+
run: |
11+
sudo dpkg --add-architecture i386
12+
sudo apt-get -qq update
713
- name: Compute Cache Hashes
814
id: compute_hashes
915
shell: bash
@@ -13,7 +19,7 @@ runs:
1319
- uses: awalsh128/cache-apt-pkgs-action@latest
1420
if: runner.os == 'Linux'
1521
with:
16-
packages: pkg-config libfuse-dev:i1386 gcc-multilib g++-multilib
22+
packages: pkg-config libfuse-dev:i386 gcc-multilib g++-multilib
1723
version: 1.0
1824

1925
- name: Set up Python

.github/hardware-roots.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Backplane
2+
app/backplane/deployment_module:
3+
- paths:
4+
- "app/backplane/deployment_module/**"
5+
- "boards/arm/deployment_module/**"
6+
7+
app/backplane/power_module:
8+
- paths:
9+
- "app/backplane/power_module/**"
10+
- "boards/arm/power_module/**"
11+
12+
app/backplane/radio_module:
13+
- paths:
14+
- "app/backplane/radio_module/**"
15+
- "boards/arm/radio_module/**"
16+
17+
app/backplane/sensor_module:
18+
- paths:
19+
- "app/backplane/sensor_module/**"
20+
- "boards/arm/sensor_module/**"
21+
22+
# Ground
23+
app/ground/receiver_module:
24+
- paths:
25+
- "app/ground/receiver_module/**"
26+
- "boards/arm/radio_module/**"
27+
28+
app/ground/tftp_server:
29+
- paths:
30+
- "app/ground/tftp_server/**"
31+
- "boards/arm/deployment_module/**"
32+
- "boards/arm/power_module/**"
33+
- "boards/arm/radio_module/**"
34+
- "boards/arm/sensor_module/**"
35+
36+
# Payload
37+
app/payload/control_freak/flight-software:
38+
- paths:
39+
- "app/payload/control_freak/flight-software/**"
40+
41+
ALL:
42+
- paths:
43+
- "data/autocoder_inputs/**"
44+
- "include/f_core/**"
45+
- "lib/f_core/**"
46+
- "snippets/**"
47+

.github/sample-roots.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
app/samples/littlefs:
2+
- paths:
3+
- "app/samples/littlefs/**"
4+
app/samples/sensor:
5+
- paths:
6+
- "app/samples/sensor/**"
7+
app/samples/shield_blinky:
8+
- paths:
9+
- "app/samples/shield_blinky/**"
10+
app/samples/shield_mcp3561r:
11+
- paths:
12+
- "app/samples/shield_mcp3561r/**"
13+
app/samples/lora_bcast:
14+
- paths:
15+
- "app/samples/lora_bcast/**"
16+
app/samples/udp_bcast:
17+
- paths:
18+
- "app/samples/udp_bcast/**"
19+
app/samples/message_passing:
20+
- paths:
21+
- "app/samples/message_passing/**"
22+
app/samples/openrocket_sensors:
23+
- paths:
24+
- "app/samples/openrocket_sensors/**"
25+
app/samples/soft_timer:
26+
- paths:
27+
- "app/samples/soft_timer/**"
28+
app/samples/tenants_and_tasks:
29+
- paths:
30+
- "app/samples/tenants_and_tasks/**"
31+
app/samples/tftp_server:
32+
- paths:
33+
- "app/samples/tftp_server/**"
34+
app/samples/datalogger:
35+
- paths:
36+
- "app/samples/datalogger/**"
37+
app/samples/gpio_blinky:
38+
- paths:
39+
- "app/samples/gpio_blinky/**"
40+
app/samples/phase_detection:
41+
- paths:
42+
- "app/samples/phase_detection/**"
43+
app/samples/horus:
44+
- paths:
45+
- "app/samples/horus/**"
46+
app/samples/compression:
47+
- paths:
48+
- "app/samples/compression/**"
49+
ALL:
50+
- paths:
51+
- "include/f_core/**"
52+
- "lib/f_core/**"
53+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env python3
2+
import sys
3+
import yaml
4+
import os
5+
import fnmatch
6+
from pathlib import Path
7+
import argparse
8+
9+
def load_mapping(map_file):
10+
with open(map_file, "r") as f:
11+
return yaml.safe_load(f)
12+
13+
def get_all_test_roots(mapping):
14+
return [k for k in mapping.keys() if k != "ALL"]
15+
16+
def main():
17+
parser = argparse.ArgumentParser(description="Determine which test roots to run based on changed files.")
18+
parser.add_argument('--map', required=True, help='YAML file with test roots map')
19+
parser.add_argument('--run-all', action='store_true', help='Run all test roots regardless of changes')
20+
args = parser.parse_args()
21+
22+
mapping = load_mapping(args.map)
23+
all_test_roots = get_all_test_roots(mapping)
24+
25+
changed_files = [line.strip() for line in sys.stdin if line.strip()]
26+
if not changed_files and not args.run_all:
27+
return
28+
29+
if args.run_all:
30+
for root in all_test_roots:
31+
print(root)
32+
return
33+
34+
selected = set()
35+
run_all = False
36+
for file in changed_files:
37+
for test_root, entries in mapping.items():
38+
for entry in entries:
39+
for pattern in entry.get("paths", []):
40+
if not pattern:
41+
continue
42+
if fnmatch.fnmatch(file, pattern):
43+
if test_root == "ALL":
44+
run_all = True
45+
else:
46+
selected.add(test_root)
47+
if run_all:
48+
for root in all_test_roots:
49+
print(root)
50+
else:
51+
for root in sorted(selected):
52+
print(root)
53+
54+
if __name__ == "__main__":
55+
main()

.github/workflows/build.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ on:
1111
- cron: "0 0 * * 1"
1212

1313
env:
14-
test_roots: |
15-
app/backplane/deployment_module
16-
app/backplane/power_module
17-
app/backplane/radio_module
18-
app/backplane/sensor_module
19-
app/ground/receiver_module
20-
app/ground/tftp_server
21-
app/payload/control_freak/flight-software
2214
platforms: |
2315
nucleo_f446re
2416
deployment_module
@@ -45,7 +37,26 @@ jobs:
4537
- name: Run Starter Steps
4638
uses: ./FSW/.github/actions/fsw-setup
4739

40+
- name: Set test_roots based on changes
41+
id: set_test_roots
42+
shell: bash
43+
working-directory: FSW
44+
run: |
45+
if [ "$GITHUB_REF_NAME" = "main" ]; then
46+
# On main branch, run all test roots
47+
python3 .github/scripts/determine_test_roots.py --map .github/hardware-roots.yaml --run-all > test_roots.txt
48+
else
49+
# On PR/branch, diff against main
50+
git fetch origin main:refs/remotes/origin/main
51+
git diff --name-only origin/main...HEAD > changed_files.txt
52+
cat changed_files.txt | python3 .github/scripts/determine_test_roots.py --map .github/hardware-roots.yaml > test_roots.txt
53+
fi
54+
echo "test_roots<<EOF" >> $GITHUB_ENV
55+
cat test_roots.txt >> $GITHUB_ENV
56+
echo "EOF" >> $GITHUB_ENV
57+
4858
- name: Build firmware
59+
if: steps.set_test_roots.outcome == 'success' && env.test_roots != ''
4960
working-directory: FSW
5061
shell: bash
5162
run: |

.github/workflows/build_samples.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,6 @@ on:
1111
- cron: "0 0 * * 1"
1212

1313
env:
14-
test_roots: |
15-
app/samples/littlefs
16-
app/samples/sensor
17-
app/samples/shield_blinky
18-
app/samples/shield_mcp3561r
19-
app/samples/lora_bcast
20-
app/samples/udp_bcast
21-
app/samples/message_passing
22-
app/samples/openrocket_sensors
23-
app/samples/soft_timer
24-
app/samples/tenants_and_tasks
25-
app/samples/tftp_server
26-
app/samples/datalogger
27-
app/samples/gpio_blinky
28-
app/samples/phase_detection
29-
app/samples/horus
30-
app/samples/compression
31-
app/samples/cpu_monitor
3214
platforms: |
3315
nucleo_f446re
3416
radio_module
@@ -55,7 +37,30 @@ jobs:
5537
- name: Run Starter Steps
5638
uses: ./FSW/.github/actions/fsw-setup
5739

40+
- name: Set test_roots based on changes
41+
id: set_test_roots
42+
shell: bash
43+
working-directory: FSW
44+
continue-on-error: false
45+
run: |
46+
if [ "$GITHUB_REF_NAME" = "main" ]; then
47+
python3 .github/scripts/determine_test_roots.py --map .github/sample-roots.yaml --run-all > test_roots.txt
48+
else
49+
git fetch origin main:refs/remotes/origin/main
50+
git diff --name-only origin/main...HEAD > changed_files.txt
51+
cat changed_files.txt | python3 .github/scripts/determine_test_roots.py --map .github/sample-roots.yaml > test_roots.txt
52+
fi
53+
if [ ! -s test_roots.txt ]; then
54+
echo "No test roots to run. Exiting early."
55+
exit 0
56+
fi
57+
echo "test_roots<<EOF" >> $GITHUB_ENV
58+
cat test_roots.txt >> $GITHUB_ENV
59+
echo "EOF" >> $GITHUB_ENV
60+
echo "Test roots set to: ${{ env.test_roots }}"
61+
5862
- name: Build firmware
63+
if: steps.set_test_roots.outcome == 'success' && env.test_roots != ''
5964
working-directory: FSW
6065
shell: bash
6166
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ app_grim_reefer/extra/out/*
7575
__pycache__
7676

7777
flash/
78+
app/payload/control_freak/flight-software/ramreport

CMakeCache.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This is the CMakeCache file.
2+
# For build in directory: /home/unknown/Clubs/Launch/Zephyr/FSW.git
3+
# It was generated by CMake: /usr/bin/cmake
4+
# You can edit this file to change values found and used by cmake.
5+
# If you do not want to change any of the values, simply exit the editor.
6+
# If you do want to change a value, simply edit, save, and exit the editor.
7+
# The syntax for the file is as follows:
8+
# KEY:TYPE=VALUE
9+
# KEY is the name of a variable in the cache.
10+
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
11+
# VALUE is the current value for the KEY.
12+
13+
########################
14+
# EXTERNAL cache entries
15+
########################
16+
17+
//Value Computed by CMake.
18+
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/home/unknown/Clubs/Launch/Zephyr/FSW.git/CMakeFiles/pkgRedirects
19+
20+
//The directory containing a CMake configuration file for Zephyr.
21+
Zephyr_DIR:PATH=Zephyr_DIR-NOTFOUND
22+
23+
24+
########################
25+
# INTERNAL cache entries
26+
########################
27+
28+
//This is the directory where this CMakeCache.txt was created
29+
CMAKE_CACHEFILE_DIR:INTERNAL=/home/unknown/Clubs/Launch/Zephyr/FSW.git
30+
//Major version of cmake used to create the current loaded cache
31+
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=4
32+
//Minor version of cmake used to create the current loaded cache
33+
CMAKE_CACHE_MINOR_VERSION:INTERNAL=0
34+
//Patch version of cmake used to create the current loaded cache
35+
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
36+
//Path to CMake executable.
37+
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
38+
//Path to cpack program executable.
39+
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
40+
//Path to ctest program executable.
41+
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
42+
//Path to cache edit program executable.
43+
CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/cmake-gui
44+
//Name of external makefile project generator.
45+
CMAKE_EXTRA_GENERATOR:INTERNAL=
46+
//Name of generator.
47+
CMAKE_GENERATOR:INTERNAL=Ninja
48+
//Generator instance identifier.
49+
CMAKE_GENERATOR_INSTANCE:INTERNAL=
50+
//Name of generator platform.
51+
CMAKE_GENERATOR_PLATFORM:INTERNAL=
52+
//Name of generator toolset.
53+
CMAKE_GENERATOR_TOOLSET:INTERNAL=
54+
//Source directory with the top level CMakeLists.txt file for this
55+
// project
56+
CMAKE_HOME_DIRECTORY:INTERNAL=/home/unknown/Clubs/Launch/Zephyr/FSW.git
57+
//Name of CMakeLists files to read
58+
CMAKE_LIST_FILE_NAME:INTERNAL=CMakeLists.txt
59+
//number of local generators
60+
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
61+
//Path to CMake installation.
62+
CMAKE_ROOT:INTERNAL=/usr/share/cmake
63+

CMakeFiles/cmake.check_cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file is generated by cmake for dependency checking of the CMakeCache.txt file

0 commit comments

Comments
 (0)