Add a json file for sdk_names and targets #1
Workflow file for this run
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: _process_image | ||
| description: Process Image for build url | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| event_name: | ||
| required: false | ||
| type: string | ||
| description: Optional event name to use for building | ||
| default: ${{ github.event_name }} | ||
| files_to_copy: | ||
| required: false | ||
| type: string | ||
| description: Optional files to copy for building | ||
| default: 'ci/files_to_copy.sh' | ||
| pr_ref: | ||
| required: false | ||
| type: string | ||
| description: Optional pull request reference to use for building | ||
| default: ${{ github.event.pull_request.head.ref }} | ||
| pr_repo: | ||
| required: false | ||
| type: string | ||
| description: Optional pull request repository to use for building | ||
| default: ${{ github.event.pull_request.head.repo.full_name }} | ||
| base_ref: | ||
| required: false | ||
| type: string | ||
| description: Optional base reference to use for building | ||
| default: ${{ github.ref_name }} | ||
| # Using rb3gen2 flat_build | ||
| env: | ||
| IMAGE_NAME: ${{ matrix.image_name }} | ||
| jobs: | ||
| process_image: | ||
| runs-on: | ||
| group: GHA-AudioReach-SelfHosted-RG | ||
| labels: [ self-hosted, self-hosted, audior-prd-u2204-x64-large-od-ephem ] | ||
| steps: | ||
| - name: Build docker Image | ||
| id: get-docker-image | ||
| uses: AudioReach/audioreach-workflows/.github/actions/build_docker_image@upstream | ||
| - name: Sync Codebase | ||
| id: sync | ||
| uses: AudioReach/audioreach-workflows/.github/actions/sync@upstream | ||
| with: | ||
| event_name: ${{ inputs.event_name }} | ||
| pr_ref: ${{ inputs.pr_ref }} | ||
| pr_repo: ${{ inputs.pr_repo }} | ||
| base_ref: ${{ inputs.base_ref }} | ||
| - name: Download build artifact | ||
| id: download_build_artifact | ||
| uses: actions/download-artifact@v6 | ||
| with: | ||
| name: build.tar | ||
| path: ${{ github.workspace }} | ||
| - name: Extract build artifact | ||
| id: extract_build_artifact | ||
| shell: bash | ||
| run: | | ||
| #!/bin/bash | ||
| set -e | ||
| mkdir -p ${{ github.workspace }}/build | ||
| echo "Extracting the build artifact" | ||
| tar -xvf ${{ github.workspace }}/build.tar -C ${{ github.workspace }}/build | ||
| echo "Build artifact extracted successfully" | ||
| - name: Pull meta-audioreach pre compiled image | ||
| id: pull_meta_audioreach | ||
| uses: AudioReach/audioreach-workflows/.github/actions/aws-s3-exchanger@upstream | ||
| with: | ||
| s3_bucket: qli-prd-audior-gh-artifacts | ||
| mode: download | ||
| download_filename: ${{ env.IMAGE_NAME }}.tar.gz | ||
| location: AudioReach/meta-audioreach/post_merge_build | ||
| - name: Extract image and mount | ||
| id: extract_image | ||
| shell: bash | ||
| run: | | ||
| #!/bin/bash | ||
| set -e | ||
| echo "Extracting the image" | ||
| tar -xvf ${{ env.IMAGE_NAME }}.tar.gz | ||
| ROOTFS_IMG=$(tar -tf ${{ env.IMAGE_NAME }}.tar.gz | grep 'rootfs.img$') | ||
| ROOTFS_DIR=$(dirname "$ROOTFS_IMG") | ||
| # Export as GitHub Actions environment variables | ||
| echo "ROOTFS_IMG=$ROOTFS_IMG" >> $GITHUB_ENV | ||
| echo "ROOTFS_DIR=$ROOTFS_DIR" >> $GITHUB_ENV | ||
| rm -rf ${{ env.IMAGE_NAME }}.tar.gz | ||
| echo "Image extracted successfully" | ||
| ls -l "$ROOTFS_DIR/rootfs.img" | ||
| # Run inside the docker container | ||
| docker run \ | ||
| --rm \ | ||
| -v $PWD:/workspace \ | ||
| -w /workspace \ | ||
| -e "ROOTFS_DIR=$ROOTFS_DIR" \ | ||
| -e "FILES_TO_COPY=${{ inputs.files_to_copy }}" \ | ||
| --privileged \ | ||
| ${{ steps.get-docker-image.outputs.image_name }} \ | ||
| bash -c ' | ||
| set -xe | ||
| cd ${ROOTFS_DIR} | ||
| sudo mkdir -p /tmp/rootfs | ||
| sudo mount rootfs.img /tmp/rootfs | ||
| echo "Image mounted successfully" | ||
| # Copy the arg build files to the mounted image | ||
| sudo bash -c "source /workspace/${FILES_TO_COPY}" | ||
| echo "Build files copied successfully" | ||
| sync | ||
| # Unmount the image | ||
| sudo umount /tmp/rootfs | ||
| echo "Image unmounted successfully" | ||
| ' | ||
| ls -l "$ROOTFS_DIR/rootfs.img" | ||
| - name: Create tar image for qcomflash directory | ||
| id: create_tar_image | ||
| shell: bash | ||
| run: | | ||
| #!/bin/bash | ||
| set -e | ||
| echo $PWD | ||
| echo "Creating tar image for qcomflash directory" | ||
| tar -czvf ${{ env.IMAGE_NAME }}.tar.gz ${{ env.ROOTFS_DIR }}/ | ||
| echo "Tar image created successfully" | ||
| - name: Upload tar image | ||
| id: upload_tar_image | ||
| uses: AudioReach/audioreach-workflows/.github/actions/aws-s3-exchanger@upstream | ||
| with: | ||
| s3_bucket: qli-prd-audior-gh-artifacts | ||
| local_file: ${{ github.workspace }}/${{ env.IMAGE_NAME }}.tar.gz | ||
| mode: upload | ||