flake.nix: Add lilac, update dependencies #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Framework Zephyr EC firmware | |
on: | |
push: | |
branches: | |
- marigold* | |
- lotus* | |
- azalea* | |
- fwk* | |
- pr-* | |
- framework* | |
# paths: | |
# - 'zephyr/program/framework/**' | |
#pull_request: | |
# branches: | |
# - marigold | |
# Dispatch only works on the main branch, so we can't actually use it here | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: [fwk-main] | |
strategy: | |
# Only build one at a time because we have only one working directory | |
max-parallel: 1 | |
matrix: | |
platform: [ | |
{ name: lilac, folder: marigold2, ver: "3.0.3", sha_len: 7, zephyr_ref: "framework-main", cmsis_ref: "cros/chromeos-main", remote: "fwk" }, | |
{ name: marigold, folder: marigold2, ver: "0.0.0", sha_len: 7, zephyr_ref: "framework-main", cmsis_ref: "cros/chromeos-main", remote: "fwk" }, | |
{ name: lotus, folder: marigold2, ver: "0.0.0", sha_len: 7, zephyr_ref: "framework-main", cmsis_ref: "cros/chromeos-main", remote: "fwk" }, | |
] | |
# Build not in $GITHUB_HOME but in the chroot env | |
defaults: | |
run: | |
working-directory: /${{ matrix.platform.folder }}/ec_home/chromiumos | |
steps: | |
# Need to manually checkout | |
# actions/checkout@v4 complains: | |
# Error: Repository path '/data/ec_home/chromiumos/src/platform/ec' is not under '/data/ec_home/actions-runner/_work/ec/ec' | |
# See: https://github.com/actions/checkout/issues/197 | |
- name: Manual checkout | |
run: | | |
pushd src/platform/ec | |
git fetch ${{ matrix.platform.remote }} | |
git clean -ffdx | |
# TODO: Doesn't work with on PR, only push | |
git reset --hard ${{ matrix.platform.remote }}/$GITHUB_REF_NAME | |
popd | |
pushd src/third_party/zephyr/main | |
git fetch ${{ matrix.platform.remote }} | |
git clean -ffdx | |
git reset --hard ${{ matrix.platform.remote }}/${{ matrix.platform.zephyr_ref }} | |
popd | |
pushd src/third_party/zephyr/cmsis | |
git fetch cros | |
git clean -ffdx | |
git reset --hard ${{ matrix.platform.cmsis_ref }} | |
popd | |
- name: Build ${{ matrix.platform.name }} ectool | |
if: ${{ matrix.platform.zephyr_ref == 'framework-main' }} | |
run: | | |
cros_sdk bash -c 'pushd ../platform/ec; BOARD=host make clean' | |
cros_sdk bash -c 'pushd ../platform/ec; BOARD=host make utils' | |
# Note: | |
# By default cros_sdk changes into src/scripts folder. | |
# But that will make zmake pick up the scripts git commit SHA | |
# To embed the ec repo's commit SHA we need to change pwd there | |
- name: Build ${{ matrix.platform.name }} (versioned) | |
if: ${{ matrix.platform.zephyr_ref == 'framework-main' }} | |
run: cros_sdk bash -c 'pushd ../platform/ec; zmake -D build -v ${{ matrix.platform.ver }} ${{ matrix.platform.name }}' | |
# zmake on lotus-zephyr branch doesn't have the -v flag | |
- name: Build ${{ matrix.platform.name }} (unversioned) | |
if: ${{ matrix.platform.zephyr_ref == 'lotus-zephyr' }} | |
run: cros_sdk bash -c 'pushd ../platform/ec; zmake -D build ${{ matrix.platform.name }}' | |
- name: File sha256 | |
run: sha256sum src/platform/ec/build/zephyr/${{ matrix.platform.name }}/output/ec.bin | |
- name: Check version embedded in binary | |
run: | | |
strings src/platform/ec/build/zephyr/${{ matrix.platform.name }}/output/ec.bin | grep ${{ matrix.platform.name }} | tee bin-strings.txt | |
grep $(echo "$GITHUB_SHA" | cut -c1-${{ matrix.platform.sha_len }}) bin-strings.txt | |
- name: Generate artifact version | |
run: | | |
echo "VERSIONINFO=$(date -u +'%Y-%m-%d-%H-%M-%S')_$GITHUB_SHA" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.platform.name }}.${{ env.VERSIONINFO }} | |
path: /${{ matrix.platform.folder }}/ec_home/chromiumos/src/platform/ec/build/zephyr/${{ matrix.platform.name }}/output | |
- name: Package dynamic libs with util (enough to run ectool) | |
run: | | |
# Check which libraries it links to | |
cros_sdk bash -c 'ldd ../platform/ec/build/host/util/ectool' | |
# Copy libraries to util folder so we can run it with | |
# sudo LD_LIBRARY_PATH=. ./ectool | |
cp chroot/usr/lib64/libec.so src/platform/ec/build/host/util/ || true | |
cp chroot/usr/lib64/libbase-core.so src/platform/ec/build/host/util/ || true | |
cp chroot/usr/lib64/libc++.so.* src/platform/ec/build/host/util/ || true | |
cp chroot/usr/lib64/libc++abi.so.* src/platform/ec/build/host/util/ || true | |
cp chroot/usr/lib64/libabseil_dll.so.* src/platform/ec/build/host/util/ || true | |
cp chroot/usr/lib64/libfmap.so.* src/platform/ec/build/host/util/ || true | |
cp chroot/usr/lib64/libbrillo-core.so src/platform/ec/build/host/util/ || true | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: util_${{ matrix.platform.name }}.${{ env.VERSIONINFO }} | |
path: /${{ matrix.platform.folder }}/ec_home/chromiumos/src/platform/ec/build/host/util |