fwk: marigold: Bump to 3.04 #2
This file contains 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: | |
- fwk-* | |
- pr-* | |
# 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: [marigold-builders] | |
strategy: | |
# Only build one at a time because we have only one working directory | |
max-parallel: 1 | |
matrix: | |
platform: [ | |
# Marigold builder uses same folder for all | |
{ name: marigold, folder: marigold1, ver: "3.0.4", sha_len: 7, zephyr_ref: "marigold", cmsis_ref: "cros/chromeos-main" }, | |
# Lotus and Azalea official releases are NOT coming from this branch | |
{ name: lotus, folder: marigold1, ver: "0.0.0", sha_len: 7, zephyr_ref: "marigold", cmsis_ref: "cros/chromeos-main" }, | |
{ name: azalea, folder: marigold1, ver: "0.0.0", sha_len: 7, zephyr_ref: "marigold", cmsis_ref: "cros/chromeos-main" }, | |
] | |
# 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 github-private | |
git clean -ffdx | |
# TODO: Doesn't work with on PR, only push | |
git reset --hard github-private/$GITHUB_REF_NAME | |
popd | |
pushd src/third_party/zephyr/main | |
git fetch github-private | |
git clean -ffdx | |
git reset --hard github-private/${{ 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 | |
# 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 == 'marigold' }} | |
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 |