Skip to content

Commit 50d297e

Browse files
authored
Fix caching (#35)
* Fix caching * Fix typo * Fix skipping targets during build * Special build-ci target * Special generate-ci target * Remove python venv cache for now... * Stop caching everything?
1 parent 2acf608 commit 50d297e

File tree

2 files changed

+63
-36
lines changed

2 files changed

+63
-36
lines changed

.github/workflows/ci.yaml

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,51 +25,67 @@ jobs:
2525
submodules: false # We'll handle submodules with smart caching
2626
fetch-depth: 0
2727

28-
- name: Cache submodules
29-
id: cache-submodules
30-
uses: actions/cache@v4
31-
with:
32-
path: |
33-
lib/fprime
34-
lib/fprime-zephyr
35-
lib/zephyr-workspace/zephyr
36-
key: project-deps-${{ hashFiles('.gitmodules') }}-v3
37-
restore-keys: |
38-
project-deps-${{ hashFiles('.gitmodules') }}-
39-
project-deps-
28+
# - name: Cache bin
29+
# id: cache-bin
30+
# uses: actions/cache@v4
31+
# with:
32+
# path: |
33+
# bin
34+
# key: bin-${{ hashFiles('Makefile') }}-v3
35+
# restore-keys: |
36+
# bin-${{ hashFiles('Makefile') }}-
37+
# bin-
38+
39+
- name: Download bin tools
40+
if: steps.cache-bin.outputs.cache-hit != 'true'
41+
run: |
42+
make download-bin
43+
44+
# - name: Cache submodules
45+
# id: cache-submodules
46+
# uses: actions/cache@v4
47+
# with:
48+
# path: |
49+
# lib/fprime
50+
# lib/fprime-zephyr
51+
# lib/zephyr-workspace/zephyr
52+
# key: submodules-${{ hashFiles('.gitmodules') }}-v3
53+
# restore-keys: |
54+
# submodules-${{ hashFiles('.gitmodules') }}-
55+
# submodules-
4056

4157
- name: Setup submodules
4258
if: steps.cache-submodules.outputs.cache-hit != 'true'
4359
run: |
4460
make submodules
4561
46-
- name: Cache python environment
47-
id: cache-python
48-
uses: actions/cache@v4
49-
with:
50-
path: fprime-venv
51-
key: python-packages-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3
52-
restore-keys: |
53-
python-packages-${{ runner.os }}-
54-
python-packages-
62+
# - name: Cache python venv
63+
# id: cache-python
64+
# uses: actions/cache@v4
65+
# with:
66+
# path: fprime-venv
67+
# key: python-venv-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3
68+
# restore-keys: |
69+
# python-venv-${{ runner.os }}-
70+
# python-venv-
5571

56-
- name: Setup python environment
72+
- name: Setup python venv
5773
if: steps.cache-python.outputs.cache-hit != 'true'
5874
run: |
5975
make fprime-venv
6076
61-
- name: Cache Zephyr workspace and SDK
62-
id: cache-zephyr
63-
uses: actions/cache@v4
64-
with:
65-
path: |
66-
lib/zephyr-workspace/modules
67-
lib/zephyr-workspace/bootloader
68-
~/zephyr-sdk-0.17.2
69-
key: zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3
70-
restore-keys: |
71-
zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-
72-
zephyr-minimal-
77+
# - name: Cache Zephyr workspace and SDK
78+
# id: cache-zephyr
79+
# uses: actions/cache@v4
80+
# with:
81+
# path: |
82+
# lib/zephyr-workspace/modules
83+
# lib/zephyr-workspace/bootloader
84+
# ~/zephyr-sdk-0.17.2
85+
# key: zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3
86+
# restore-keys: |
87+
# zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}-
88+
# zephyr-
7389

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

8298
- name: Build
8399
run: |
84-
# Skip both zephyr-setup and submodules since we cached them separately
85-
make build -o zephyr-setup -o submodules
100+
make generate-ci build-ci
86101
87102
- name: Upload build artifacts
88103
uses: actions/upload-artifact@v4

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ generate: submodules fprime-venv zephyr-setup ## Generate FPrime-Zephyr Proves C
4646
@echo "Generating FPrime-Zephyr Proves Core Reference..."
4747
@$(UV) run fprime-util generate --force
4848

49+
.PHONY: generate-ci
50+
generate-ci:
51+
@$(UV) run fprime-util generate --force
52+
4953
.PHONY: generate-if-needed
5054
BUILD_DIR ?= $(shell pwd)/build-fprime-automatic-zephyr
5155
generate-if-needed:
@@ -56,6 +60,10 @@ build: submodules zephyr-setup fprime-venv generate-if-needed ## Build FPrime-Ze
5660
@echo "Building..."
5761
@$(UV) run fprime-util build
5862

63+
.PHONY: build-ci
64+
build-ci:
65+
@$(UV) run fprime-util build
66+
5967
.PHONY: test-integration
6068
test-integration:
6169
@$(UV) run pytest FprimeZephyrReference/test/int --deployment build-artifacts/zephyr/fprime-zephyr-deployment
@@ -83,6 +91,10 @@ gds: ## Run FPrime GDS
8391
@$(UV) run fprime-gds -n --dictionary $(ARTIFACT_DIR)/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json --communication-selection uart --uart-baud 115200 --output-unframed-data
8492

8593
##@ Build Tools
94+
95+
.PHONY: download-bin
96+
download-bin: uv
97+
8698
BIN_DIR ?= $(shell pwd)/bin
8799
$(BIN_DIR):
88100
mkdir -p $(BIN_DIR)

0 commit comments

Comments
 (0)