|
| 1 | +name: Build debos recipe |
| 2 | + |
| 3 | +on: |
| 4 | + # run on pull requests to the main branch |
| 5 | + pull_request: |
| 6 | + branches: [main] |
| 7 | + # run on pushes to the main branch |
| 8 | + push: |
| 9 | + branches: [main] |
| 10 | + # run daily at 8:30am |
| 11 | + schedule: |
| 12 | + - cron: '30 8 * * *' |
| 13 | + # allow manual runs |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +# only need permission to read repository; implicitely set all other |
| 17 | +# permissions to none |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +defaults: |
| 22 | + # run all commands from the debos-recipes directory |
| 23 | + run: |
| 24 | + working-directory: debos-recipes |
| 25 | + |
| 26 | +env: |
| 27 | + FILESERVER_URL: https://quic-yocto-fileserver-1029608027416.us-central1.run.app |
| 28 | + |
| 29 | +# cancel in progress builds for this workflow triggered by the same ref |
| 30 | +concurrency: |
| 31 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 32 | + cancel-in-progress: true |
| 33 | + |
| 34 | +jobs: |
| 35 | + build-debos: |
| 36 | + runs-on: [self-hosted, arm64, debbuilder] |
| 37 | + container: |
| 38 | + image: debian:trixie |
| 39 | + volumes: |
| 40 | + - /srv/gh-runners/quic-yocto/builds:/fileserver-builds |
| 41 | + options: --privileged |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + with: |
| 45 | + fetch-depth: 0 |
| 46 | + |
| 47 | + # make sure we have latest packages first, to get latest fixes and to |
| 48 | + # avoid an automated update while we're building |
| 49 | + - name: Update OS packages |
| 50 | + run: | |
| 51 | + set -x |
| 52 | + apt update |
| 53 | + apt -y upgrade |
| 54 | + apt -y full-upgrade |
| 55 | + # debos is needed to build recipes, mtools is needed for the flash |
| 56 | + # recipe |
| 57 | + apt -y install debos mtools |
| 58 | + |
| 59 | + - name: Build debos recipe |
| 60 | + run: | |
| 61 | + set -x |
| 62 | + # start by building the root filesystem |
| 63 | + debos qualcomm-linux-debian-rootfs.yaml |
| 64 | + # debos tries KVM and UML as backends, and falls back to |
| 65 | + # building directly on the host, but that requires loop |
| 66 | + # devices; use qemu backend explicitly even if it's slower |
| 67 | + # qemu backend also requires to set scratchsize, otherwise the |
| 68 | + # whole build is done from memory and the out of memory killer |
| 69 | + # gets triggered |
| 70 | + debos -b qemu --scratchsize 4GiB -t imagetype:ufs \ |
| 71 | + qualcomm-linux-debian-image.yaml |
| 72 | + debos -b qemu --scratchsize 4GiB -t imagetype:sdcard \ |
| 73 | + qualcomm-linux-debian-image.yaml |
| 74 | + # build flashable files |
| 75 | + debos qualcomm-linux-debian-flash.yaml |
| 76 | + |
| 77 | + - name: Upload artifacts to fileserver |
| 78 | + run: | |
| 79 | + set -x |
| 80 | + # curl will be used to talk to fileserver; should be installed by |
| 81 | + # default |
| 82 | + apt -y install curl |
| 83 | + # github runs are only unique per repository and may also be re-run; |
| 84 | + # create an unique id with repository, run id, and run attempt |
| 85 | + id="${GITHUB_REPOSITORY}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" |
| 86 | + # create a directory for the current run |
| 87 | + dir="/fileserver-builds/${id}" |
| 88 | + mkdir -vp "${dir}" |
| 89 | + # copy output files |
| 90 | + cp -av rootfs.tar.gz "${dir}" |
| 91 | + cp -av dtbs.tar.gz "${dir}" |
| 92 | + cp -av disk-ufs.img.gz "${dir}" |
| 93 | + cp -av disk-sdcard.img.gz "${dir}" |
| 94 | + tar -cvf "${dir}"/flash.tar.gz disk-ufs.img1 disk-ufs.img2 flash_* |
| 95 | + # instruct fileserver to publish this directory |
| 96 | + url="${FILESERVER_URL}/${id}/" |
| 97 | + curl -X POST -H 'Accept: text/event-stream' "${url}" |
| 98 | + |
0 commit comments