Skip to content

Fix caching

Fix caching #185

Workflow file for this run

name: ci
on:
pull_request:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint
run: |
make fmt
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
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-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 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'
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: Setup Zephyr
if: steps.cache-zephyr.outputs.cache-hit != 'true'
run: |
make zephyr-setup
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
PIP_NO_COMPILE: 1
- name: Build
run: |
make generate-ci build-ci
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
build-artifacts/zephyr.uf2
build-artifacts/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json
retention-days: 30