From 4959e800204eef654f7233c62f740d61a95459ac Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sat, 4 Oct 2025 19:35:06 -0500 Subject: [PATCH 1/7] Fix caching --- .github/workflows/ci.yaml | 38 +++++++++++++++++++++++++++----------- Makefile | 4 ++++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a4403967..34371626 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,6 +25,22 @@ jobs: submodules: false # We'll handle submodules with smart caching fetch-depth: 0 + - 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-submodules.outputs.cache-hit != 'true' + run: | + make download-bin + - name: Cache submodules id: cache-submodules uses: actions/cache@v4 @@ -33,27 +49,27 @@ jobs: lib/fprime lib/fprime-zephyr lib/zephyr-workspace/zephyr - key: project-deps-${{ hashFiles('.gitmodules') }}-v3 + key: submodules-${{ hashFiles('.gitmodules') }}-v3 restore-keys: | - project-deps-${{ hashFiles('.gitmodules') }}- - project-deps- + submodules-${{ hashFiles('.gitmodules') }}- + submodules- - name: Setup submodules if: steps.cache-submodules.outputs.cache-hit != 'true' run: | make submodules - - name: Cache python environment + - name: Cache python venv id: cache-python uses: actions/cache@v4 with: path: fprime-venv - key: python-packages-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3 + key: python-venv-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3 restore-keys: | - python-packages-${{ runner.os }}- - python-packages- + 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 @@ -66,10 +82,10 @@ jobs: lib/zephyr-workspace/modules lib/zephyr-workspace/bootloader ~/zephyr-sdk-0.17.2 - key: zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3 + key: zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3 restore-keys: | - zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}- - zephyr-minimal- + zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}- + zephyr- - name: Setup Zephyr if: steps.cache-zephyr.outputs.cache-hit != 'true' diff --git a/Makefile b/Makefile index 1703c2f2..12cb2e99 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,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) From 3da11da0cadf61b9fdbe319cdbeb26e8a318d83f Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sat, 4 Oct 2025 19:50:16 -0500 Subject: [PATCH 2/7] Fix typo --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 34371626..3f6c1220 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,11 +33,11 @@ jobs: bin key: bin-${{ hashFiles('Makefile') }}-v3 restore-keys: | - bin-${{ hashFiles('.Makefile') }}- + bin-${{ hashFiles('Makefile') }}- bin- - name: Download bin tools - if: steps.cache-submodules.outputs.cache-hit != 'true' + if: steps.cache-bin.outputs.cache-hit != 'true' run: | make download-bin @@ -98,7 +98,7 @@ jobs: - name: Build run: | # Skip both zephyr-setup and submodules since we cached them separately - make build -o zephyr-setup -o submodules + make -o zephyr-setup -o submodules build - name: Upload build artifacts uses: actions/upload-artifact@v4 From 1a9ba54d2bffd0b255818ecaac6bf390013d76c6 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sat, 4 Oct 2025 19:52:48 -0500 Subject: [PATCH 3/7] Fix skipping targets during build --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3f6c1220..d81285c3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,8 +97,7 @@ jobs: - name: Build run: | - # Skip both zephyr-setup and submodules since we cached them separately - make -o zephyr-setup -o submodules build + make build -W submodules -W zephyr-setup -W fprime-venv - name: Upload build artifacts uses: actions/upload-artifact@v4 From 8b5322fe4df286a1e34d1fad163a83fbc98e9800 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sat, 4 Oct 2025 20:01:29 -0500 Subject: [PATCH 4/7] Special build-ci target --- .devcontainer/devcontainer.json | 22 ++++++++++++++++++++++ .github/workflows/ci.yaml | 2 +- Makefile | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..87041364 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,22 @@ +{ + "image": "mcr.microsoft.com/devcontainers/cpp:debian-12", + "privileged": true, + "features": { + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "jet-propulsion-laboratory.fpp", + "ms-vscode.cpptools", + "ms-vscode.cmake-tools", + "ms-vscode.makefile-tools", + "plorefice.devicetree", + "nordic-semiconductor.nrf-kconfig", + "ms-python.python" + ] + } + }, + "postCreateCommand": "make" +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d81285c3..3a8c70a5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,7 +97,7 @@ jobs: - name: Build run: | - make build -W submodules -W zephyr-setup -W fprime-venv + make build-ci - name: Upload build artifacts uses: actions/upload-artifact@v4 diff --git a/Makefile b/Makefile index 12cb2e99..bcfa5487 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,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: generate-if-needed + @$(UV) run fprime-util build + .PHONY: test-integration test-integration: @$(UV) run pytest FprimeZephyrReference/test/int --deployment build-artifacts/zephyr/fprime-zephyr-deployment From d5403b111a6a79585dd4515bc6eef795f718a3b6 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sat, 4 Oct 2025 20:04:08 -0500 Subject: [PATCH 5/7] Special generate-ci target --- .github/workflows/ci.yaml | 2 +- Makefile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3a8c70a5..e6ba0539 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -97,7 +97,7 @@ jobs: - name: Build run: | - make build-ci + make generate-ci build-ci - name: Upload build artifacts uses: actions/upload-artifact@v4 diff --git a/Makefile b/Makefile index bcfa5487..01518a86 100644 --- a/Makefile +++ b/Makefile @@ -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: @@ -57,7 +61,7 @@ build: submodules zephyr-setup fprime-venv generate-if-needed ## Build FPrime-Ze @$(UV) run fprime-util build .PHONY: build-ci -build-ci: generate-if-needed +build-ci: @$(UV) run fprime-util build .PHONY: test-integration From 5997380f943137c2b118c43d740652138b228ece Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sat, 4 Oct 2025 20:12:41 -0500 Subject: [PATCH 6/7] Remove python venv cache for now... --- .github/workflows/ci.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e6ba0539..d5f69ced 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,15 +59,15 @@ jobs: run: | make submodules - - 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: 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 venv if: steps.cache-python.outputs.cache-hit != 'true' From 13166da74d666c3d22165cf4f6f9172c95292aad Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Sat, 4 Oct 2025 20:16:17 -0500 Subject: [PATCH 7/7] Stop caching everything? --- .devcontainer/devcontainer.json | 22 ----------- .github/workflows/ci.yaml | 68 ++++++++++++++++----------------- 2 files changed, 34 insertions(+), 56 deletions(-) delete mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 87041364..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "image": "mcr.microsoft.com/devcontainers/cpp:debian-12", - "privileged": true, - "features": { - "ghcr.io/devcontainers/features/git:1": {}, - "ghcr.io/devcontainers/features/github-cli:1": {} - }, - "customizations": { - "vscode": { - "extensions": [ - "jet-propulsion-laboratory.fpp", - "ms-vscode.cpptools", - "ms-vscode.cmake-tools", - "ms-vscode.makefile-tools", - "plorefice.devicetree", - "nordic-semiconductor.nrf-kconfig", - "ms-python.python" - ] - } - }, - "postCreateCommand": "make" -} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d5f69ced..a1764265 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,34 +25,34 @@ jobs: submodules: false # We'll handle submodules with smart caching fetch-depth: 0 - - 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: 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: 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' @@ -74,18 +74,18 @@ jobs: 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-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3 - restore-keys: | - zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}- - zephyr- + # - 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'