Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 51 additions & 36 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,51 +25,67 @@ jobs:
submodules: false # We'll handle submodules with smart caching
fetch-depth: 0

- name: Cache submodules
id: cache-submodules
uses: actions/cache@v4
with:
path: |
lib/fprime
lib/fprime-zephyr
lib/zephyr-workspace/zephyr
key: project-deps-${{ hashFiles('.gitmodules') }}-v3
restore-keys: |
project-deps-${{ hashFiles('.gitmodules') }}-
project-deps-
# - name: Cache bin
# id: cache-bin
# uses: actions/cache@v4
# with:
# path: |
# bin
# key: bin-${{ hashFiles('Makefile') }}-v3
# restore-keys: |
# bin-${{ hashFiles('Makefile') }}-
# bin-

- name: Download bin tools
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
make download-bin

# - name: Cache submodules
# id: cache-submodules
# uses: actions/cache@v4
# with:
# path: |
# lib/fprime
# lib/fprime-zephyr
# lib/zephyr-workspace/zephyr
# key: submodules-${{ hashFiles('.gitmodules') }}-v3
# restore-keys: |
# submodules-${{ hashFiles('.gitmodules') }}-
# submodules-

- name: Setup submodules
if: steps.cache-submodules.outputs.cache-hit != 'true'
run: |
make submodules

- name: Cache python environment
id: cache-python
uses: actions/cache@v4
with:
path: fprime-venv
key: python-packages-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3
restore-keys: |
python-packages-${{ runner.os }}-
python-packages-
# - name: Cache python venv
# id: cache-python
# uses: actions/cache@v4
# with:
# path: fprime-venv
# key: python-venv-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3
# restore-keys: |
# python-venv-${{ runner.os }}-
# python-venv-

- name: Setup python environment
- name: Setup python venv
if: steps.cache-python.outputs.cache-hit != 'true'
run: |
make fprime-venv

- name: Cache Zephyr workspace and SDK
id: cache-zephyr
uses: actions/cache@v4
with:
path: |
lib/zephyr-workspace/modules
lib/zephyr-workspace/bootloader
~/zephyr-sdk-0.17.2
key: zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3
restore-keys: |
zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-
zephyr-minimal-
# - name: Cache Zephyr workspace and SDK
# id: cache-zephyr
# uses: actions/cache@v4
# with:
# path: |
# lib/zephyr-workspace/modules
# lib/zephyr-workspace/bootloader
# ~/zephyr-sdk-0.17.2
# key: zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3
# restore-keys: |
# zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}-
# zephyr-

- name: Setup Zephyr
if: steps.cache-zephyr.outputs.cache-hit != 'true'
Expand All @@ -81,8 +97,7 @@ jobs:

- name: Build
run: |
# Skip both zephyr-setup and submodules since we cached them separately
make build -o zephyr-setup -o submodules
make generate-ci build-ci

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ generate: submodules fprime-venv zephyr-setup ## Generate FPrime-Zephyr Proves C
@echo "Generating FPrime-Zephyr Proves Core Reference..."
@$(UV) run fprime-util generate --force

.PHONY: generate-ci
generate-ci:
@$(UV) run fprime-util generate --force

.PHONY: generate-if-needed
BUILD_DIR ?= $(shell pwd)/build-fprime-automatic-zephyr
generate-if-needed:
Expand All @@ -56,6 +60,10 @@ build: submodules zephyr-setup fprime-venv generate-if-needed ## Build FPrime-Ze
@echo "Building..."
@$(UV) run fprime-util build

.PHONY: build-ci
build-ci:
@$(UV) run fprime-util build

.PHONY: test-integration
test-integration:
@$(UV) run pytest FprimeZephyrReference/test/int --deployment build-artifacts/zephyr/fprime-zephyr-deployment
Expand Down Expand Up @@ -83,6 +91,10 @@ gds: ## Run FPrime GDS
@$(UV) run fprime-gds -n --dictionary $(ARTIFACT_DIR)/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json --communication-selection uart --uart-baud 115200 --output-unframed-data

##@ Build Tools

.PHONY: download-bin
download-bin: uv

BIN_DIR ?= $(shell pwd)/bin
$(BIN_DIR):
mkdir -p $(BIN_DIR)
Expand Down