sync with lx2160a_build / read mac addresses from tlv eeprom #32
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 | |
on: | |
push: | |
branches: [ "kirkstone" ] | |
pull_request: | |
branches: [ "kirkstone" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
prepare_container: | |
runs-on: self-hosted | |
outputs: | |
uid: ${{ steps.uid_step.outputs.userid }} | |
gid: ${{ steps.uid_step.outputs.groupid }} | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Get user id/group | |
id: uid_step | |
run: | | |
echo "userid=$(id -u)" >> "$GITHUB_OUTPUT" | |
echo "groupid=$(id -g)" >> "$GITHUB_OUTPUT" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-config: /etc/docker/cibuilder.toml | |
- name: Login to Docker Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ciserver.ci:5000 | |
username: ${{ secrets.CI_CACHE_REGISTRY_LOGIN }} | |
password: ${{ secrets.CI_CACHE_REGISTRY_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ciserver.ci:5000/${{ github.repository_id }}:latest | |
cache-from: type=registry,ref=ciserver.ci:5000/${{ github.repository_id }}:cache | |
cache-to: type=registry,ref=ciserver.ci:5000/${{ github.repository_id }}:cache,mode=max | |
file: conf/docker/Dockerfile | |
build-args: | | |
USER_ID=${{ steps.uid_step.outputs.userid }} | |
GROUP_ID=${{ steps.uid_step.outputs.groupid }} | |
build_images: | |
needs: prepare_container | |
runs-on: self-hosted | |
timeout-minutes: 1080 | |
container: | |
image: ciserver.ci:5000/${{ github.repository_id }}:latest | |
credentials: | |
username: ${{ secrets.CI_CACHE_REGISTRY_LOGIN }} | |
password: ${{ secrets.CI_CACHE_REGISTRY_PASSWORD }} | |
options: --user "${{ needs.prepare_container.outputs.uid }}:${{ needs.prepare_container.outputs.gid }}" | |
outputs: | |
build_tag: ${{ steps.tag_step.outputs.build_tag }} | |
steps: | |
- name: Checkout dependency layers | |
shell: bash {0} | |
run: | | |
repo init -u https://github.com/nxp-qoriq/yocto-sdk.git -b kirkstone -m ls-5.15.71-2.2.0.xml | |
repo sync | |
- name: Checkout pull-request version of meta-solidrun-arm-lx2xxx | |
uses: actions/checkout@v4 | |
with: | |
path: sources/meta-solidrun-arm-lx2xxx | |
- name: Patch dependency layers | |
shell: bash {0} | |
run: | | |
pushd sources/poky | |
git am ../../sources/meta-solidrun-arm-lx2xxx/patches/poky/*.patch | |
popd | |
- name: Get build tag | |
shell: bash {0} | |
id: tag_step | |
run: | | |
build_tag=$(date +%Y-%m-%d)_$(cd sources/meta-solidrun-arm-lx2xxx; git rev-parse --short HEAD) | |
echo "build_tag=$build_tag" >> "$GITHUB_OUTPUT" | |
- name: Create cache dir | |
run: mkdir -p buildcache | |
- name: Fetch cache from server | |
uses: tespkg/actions-cache/restore@v1 | |
with: | |
endpoint: ciserver.ci | |
port: 9000 | |
insecure: true | |
accessKey: ${{ secrets.CI_CACHE_MINIO_ACCESS }} | |
secretKey: ${{ secrets.CI_CACHE_MINIO_SECRET }} | |
bucket: cicache | |
use-fallback: false | |
key: ${{ github.repository }} | |
path: | | |
buildcache | |
- name: Configure | |
shell: bash {0} | |
run: | | |
EULA=1 | |
. ./setup-env -m lx2160ardb-rev2 -b build | |
printf 'BBLAYERS += "%s"\n' $GITHUB_WORKSPACE/sources/meta-solidrun-arm-lx2xxx >> conf/bblayers.conf | |
echo "require conf/includes/ci.conf" >> conf/local.conf | |
- name: Download Sources (ignore errors) | |
shell: bash {0} | |
run: | | |
cd build | |
source ./SOURCE_THIS | |
export CACHE_DIR="$GITHUB_WORKSPACE/buildcache" | |
export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS CACHE_DIR" | |
MACHINE=lx2160a-rev2-clearfog-cx bitbake -k fsl-image-networking --runall=fetch | |
MACHINE=lx2160a-rev2-honeycomb bitbake -k fsl-image-networking --runall=fetch | |
MACHINE=lx2162a-rev2-clearfog bitbake -k fsl-image-networking --runall=fetch | |
continue-on-error: true | |
- name: Build (ignore errors) | |
id: build_step | |
shell: bash {0} | |
run: | | |
cd build | |
source ./SOURCE_THIS | |
export CACHE_DIR="$GITHUB_WORKSPACE/buildcache" | |
export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS CACHE_DIR" | |
export IMAGE=fsl-image-networking | |
export MACHINE=lx2160a-rev2-clearfog-cx | |
bitbake -k $IMAGE | |
wic create -o wic-$MACHINE lx2160a-bootimg-mmc -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-bootimg-mmc.wks*.direct $IMAGE-$MACHINE-bootimg-mmc.wic | |
wic create -o wic-$MACHINE lx2160a-bootimg-xspi -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-bootimg-xspi.wks*.direct $IMAGE-$MACHINE-bootimg-xspi.wic | |
wic create -o wic-$MACHINE lx2160a-rootimg -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-rootimg.wks*.direct $IMAGE-$MACHINE-rootimg.wic | |
export MACHINE=lx2160a-rev2-honeycomb | |
bitbake -k $IMAGE | |
wic create -o wic-$MACHINE lx2160a-bootimg-mmc -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-bootimg-mmc.wks*.direct $IMAGE-$MACHINE-bootimg-mmc.wic | |
wic create -o wic-$MACHINE lx2160a-bootimg-xspi -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-bootimg-xspi.wks*.direct $IMAGE-$MACHINE-bootimg-xspi.wic | |
wic create -o wic-$MACHINE lx2160a-rootimg -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-rootimg.wks*.direct $IMAGE-$MACHINE-rootimg.wic | |
export MACHINE=lx2162a-rev2-clearfog | |
bitbake -k $IMAGE | |
wic create -o wic-$MACHINE lx2160a-bootimg-mmc -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-bootimg-mmc.wks*.direct $IMAGE-$MACHINE-bootimg-mmc.wic | |
wic create -o wic-$MACHINE lx2160a-bootimg-xspi -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-bootimg-xspi.wks*.direct $IMAGE-$MACHINE-bootimg-xspi.wic | |
wic create -o wic-$MACHINE lx2160a-rootimg -e $IMAGE | |
ln -sv wic-$MACHINE/lx2160a-rootimg.wks*.direct $IMAGE-$MACHINE-rootimg.wic | |
continue-on-error: true | |
- name: Update cache on the server (build may have failed) | |
# if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
uses: tespkg/actions-cache/save@v1 | |
with: | |
endpoint: ciserver.ci | |
port: 9000 | |
insecure: true | |
accessKey: ${{ secrets.CI_CACHE_MINIO_ACCESS }} | |
secretKey: ${{ secrets.CI_CACHE_MINIO_SECRET }} | |
bucket: cicache | |
use-fallback: false | |
key: ${{ github.repository }} | |
path: | | |
buildcache | |
- name: Fail Late | |
if: failure() && steps.build_step.outcome == 'failure' | |
shell: bash {0} | |
run: | | |
false | |
- name: Select artifacts for publishing | |
shell: bash -e {0} | |
run: | | |
export IMAGE=fsl-image-networking | |
export MACHINE=lx2160a-rev2-clearfog-cx | |
mkdir deploy | |
cp -L build/tmp/deploy/images/$MACHINE/$IMAGE-$MACHINE.ext2.gz deploy | |
cp -L build/tmp/deploy/images/$MACHINE/$IMAGE-$MACHINE.manifest deploy | |
pushd build/tmp/deploy/images/$MACHINE; tar -cpzf device-tree-$MACHINE.tgz freescale/*.dtb; popd | |
mv build/tmp/deploy/images/$MACHINE/device-tree-$MACHINE.tgz deploy | |
cp -L build/tmp/deploy/images/$MACHINE/Image deploy/Image-$MACHINE | |
cp -L build/tmp/deploy/images/$MACHINE/modules-$MACHINE.tgz deploy | |
cp -L build/$IMAGE-$MACHINE-bootimg-mmc.wic deploy | |
cp -L build/$IMAGE-$MACHINE-bootimg-xspi.wic deploy | |
cp -L build/$IMAGE-$MACHINE-rootimg.wic deploy | |
export MACHINE=lx2160a-rev2-honeycomb | |
cp -L build/tmp/deploy/images/$MACHINE/$IMAGE-$MACHINE.ext2.gz deploy | |
cp -L build/tmp/deploy/images/$MACHINE/$IMAGE-$MACHINE.manifest deploy | |
pushd build/tmp/deploy/images/$MACHINE; tar -cpzf device-tree-$MACHINE.tgz freescale/*.dtb; popd | |
mv build/tmp/deploy/images/$MACHINE/device-tree-$MACHINE.tgz deploy | |
cp -L build/tmp/deploy/images/$MACHINE/Image deploy/Image-$MACHINE | |
cp -L build/tmp/deploy/images/$MACHINE/modules-$MACHINE.tgz deploy | |
cp -L build/$IMAGE-$MACHINE-bootimg-mmc.wic deploy | |
cp -L build/$IMAGE-$MACHINE-bootimg-xspi.wic deploy | |
cp -L build/$IMAGE-$MACHINE-rootimg.wic deploy | |
export MACHINE=lx2162a-rev2-clearfog | |
cp -L build/tmp/deploy/images/$MACHINE/$IMAGE-$MACHINE.ext2.gz deploy | |
cp -L build/tmp/deploy/images/$MACHINE/$IMAGE-$MACHINE.manifest deploy | |
pushd build/tmp/deploy/images/$MACHINE; tar -cpzf device-tree-$MACHINE.tgz freescale/*.dtb; popd | |
mv build/tmp/deploy/images/$MACHINE/device-tree-$MACHINE.tgz deploy | |
cp -L build/tmp/deploy/images/$MACHINE/Image deploy/Image-$MACHINE | |
cp -L build/tmp/deploy/images/$MACHINE/modules-$MACHINE.tgz deploy | |
cp -L build/$IMAGE-$MACHINE-bootimg-mmc.wic deploy | |
cp -L build/$IMAGE-$MACHINE-bootimg-xspi.wic deploy | |
cp -L build/$IMAGE-$MACHINE-rootimg.wic deploy | |
xz -9 deploy/*.wic | |
ls -lh deploy/* | |
- name: Deploy to the local minio storage | |
uses: yakubique/[email protected] | |
with: | |
endpoint: http://ciserver.ci:9000 | |
insecure: true | |
access_key: ${{ secrets.CI_CACHE_MINIO_ACCESS }} | |
secret_key: ${{ secrets.CI_CACHE_MINIO_SECRET }} | |
bucket: cipublish | |
source: ./deploy | |
target: "/${{ github.repository_id }}/${{ steps.tag_step.outputs.build_tag }}" | |
recursive: true | |
publish_images: | |
needs: build_images | |
runs-on: self-hosted | |
if: github.ref == 'refs/heads/kirkstone' && github.event_name != 'pull_request' | |
steps: | |
- name: Download an artifacts from MinIO | |
uses: yakubique/[email protected] | |
with: | |
endpoint: http://ciserver.ci:9000 | |
insecure: true | |
access_key: ${{ secrets.CI_CACHE_MINIO_ACCESS }} | |
secret_key: ${{ secrets.CI_CACHE_MINIO_SECRET }} | |
bucket: cipublish | |
source: "/${{ github.repository_id }}/${{ needs.build_images.outputs.build_tag }}/" | |
target: "." | |
recursive: true | |
- name: Upload to S3 | |
uses: shallwefootball/[email protected] | |
with: | |
aws_key_id: ${{ secrets.IMAGES_S3_ACCESS }} | |
aws_secret_access_key: ${{ secrets.IMAGES_S3_SECRET }} | |
aws_bucket: ${{ secrets.IMAGES_S3_BUCKET }} | |
endpoint: ${{ secrets.IMAGES_S3_HOST }} | |
source_dir: deploy | |
destination_dir: LX2k/meta-solidrun-arm-lx2xxx/${{ needs.build_images.outputs.build_tag }} |