Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions .github/actions/compile/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: Run kas for a specific build configuration
inputs:
machine:
required: true
distro_yaml:
required: true
distro_name:
required: true
kernel_yaml:
required: true
kernel_dirname:
required: true
cache_dir:
required: true
sdk:
required: false
default: "0"
outputs:
url:
description: Location of the published binaries
value: ${{ steps.upload_artifacts.outputs.url }}
runs:
using: "composite"
steps:
- name: Download kas lockfile
uses: actions/download-artifact@v6
with:
name: kas-lockfile
path: ci/

- name: Download kas-container
uses: actions/download-artifact@v6
with:
name: kas-container
path: ${{runner.temp}}

- name: Setting up kas-container
shell: bash
run: |
KAS_CONTAINER=$RUNNER_TEMP/kas-container
echo "KAS_CONTAINER=$KAS_CONTAINER" >> $GITHUB_ENV
chmod +x $KAS_CONTAINER

- name: Setup build variables and sstate-cache
shell: bash
run: |
# use a monthly sstate cache folder
echo "DL_DIR=${{inputs.cache_dir}}/downloads" >> $GITHUB_ENV
echo "SSTATE_DIR=${{inputs.cache_dir}}/sstate-cache-$(date '+%Y-%m')" >> $GITHUB_ENV
echo "KAS_WORK_DIR=$PWD/../kas" >> $GITHUB_ENV

- name: Dump kas-build yaml
shell: bash
run: |
mkdir $KAS_WORK_DIR
$KAS_CONTAINER dump --resolve-env --resolve-local --resolve-refs \
ci/mirror.yml:ci/${{ inputs.machine }}.yml${{ inputs.distro_yaml }}${{ inputs.kernel_yaml }} > kas-build.yml

- name: Kas qcom world build
shell: bash
run: |
$KAS_CONTAINER build ci/mirror.yml:ci/${{ inputs.machine }}.yml${{ inputs.distro_yaml }}${{ inputs.kernel_yaml }}:ci/world.yml
ci/kas-container-shell-helper.sh ci/yocto-pybootchartgui.sh
mv $KAS_WORK_DIR/build/buildchart.svg buildchart-world.svg

- name: Kas build images
shell: bash
run: |
$KAS_CONTAINER build ci/mirror.yml:ci/${{ inputs.machine }}.yml${{ inputs.distro_yaml }}${{ inputs.kernel_yaml }}
ci/kas-container-shell-helper.sh ci/yocto-pybootchartgui.sh
mv $KAS_WORK_DIR/build/buildchart.svg .

if [ "${{ inputs.machine }}" = "qcom-armv8a" ]; then
$KAS_CONTAINER build ci/mirror.yml:ci/${{ inputs.machine }}.yml${{ inputs.distro_yaml }}${{ inputs.kernel_yaml }}:ci/initramfs-test.yml

# SDK only with the default kernel
if [ "${{ inputs.sdk }}" = "1" ] && [ "${{ inputs.kernel_yaml }}" = "" ] ; then
$KAS_CONTAINER build ci/mirror.yml:ci/${{ inputs.machine }}.yml${{ inputs.distro_yaml }}${{ inputs.kernel_yaml }} --task populate_sdk
fi
fi

- uses: actions/upload-artifact@v6
with:
name: buildchart-${{ inputs.distro_name }}${{ inputs.kernel_dirname }}-${{ inputs.machine }}
path: |
buildchart.svg
buildchart-world.svg

- uses: actions/upload-artifact@v6
with:
name: kas-build-${{ inputs.distro_name }}${{ inputs.kernel_dirname }}-${{ inputs.machine }}
path: kas-build.yml

- name: Stage build artifacts for publishing
shell: bash
run: |
# The upload-private-artifact-action runs from a container that
# expects file to be relative to our PWD. deploy_dir is outside
# that, so we move things around:
deploy_dir=../kas/build/tmp/deploy/images/${{inputs.machine}}
uploads_dir=./uploads/${{ inputs.distro_name }}${{ inputs.kernel_dirname }}/${{ inputs.machine }}
mkdir -p $uploads_dir
# Publish everything that is linked by bitbake at the end of the build (avoid timestamp and duplication)
find $deploy_dir/ -maxdepth 1 -type l -exec cp --dereference {} $uploads_dir/ \;
# Files without links: *.vfat, *.elf, *.efi, efi.stub, fit *.its, qcom-metadata.dtb and qclinuxfitImage
# Copy *.efi, *.efi and *.vfat as they are useful for debugging
find $deploy_dir/ -maxdepth 1 -type f \( -name \*.efi -o -name \*.elf -o -name dtb-\*.vfat \) -exec cp {} $uploads_dir/ \;
cp buildchart.svg kas-build.yml $uploads_dir/
if [ -d $deploy_dir/../../sdk ]; then
cp $deploy_dir/../../sdk/* $uploads_dir/
fi

- name: Upload private artifacts
uses: qualcomm-linux/upload-private-artifact-action@v1
id: upload_artifacts
with:
path: ./uploads

- name: Upload artifacts to S3 bucket
uses: qualcomm-linux/upload-private-artifact-action@aws-v1
with:
path: ./uploads
destination: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.run_id }}-${{ github.run_attempt }}/
s3_bucket: qcom-prd-gh-artifacts

- name: "Print output"
shell: bash
id: print-output
run: |
KERNEL_DIRNAME="${{ inputs.kernel_dirname }}"
BUILDNAME="${{ inputs.machine }}_${{ inputs.distro_name }}${KERNEL_DIRNAME}"
FILENAME="build-url_${BUILDNAME}"
echo "${{ steps.upload_artifacts.outputs.url }}" > "${FILENAME}"
echo "filename=${FILENAME}" >> $GITHUB_OUTPUT
- name: Upload build URL
uses: actions/upload-artifact@v6
with:
overwrite: true
name: ${{ steps.print-output.outputs.filename }}
path: ${{ steps.print-output.outputs.filename }}

Loading
Loading