|
| 1 | +name: Build Linux deb for Qualcomm hardware |
| 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 weekly on Monday at 8:30am |
| 11 | + schedule: |
| 12 | + - cron: '30 8 * * 1' |
| 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 | +env: |
| 22 | + # where results will be posted/hosted |
| 23 | + FILESERVER_URL: https://quic-yocto-fileserver-1029608027416.us-central1.run.app |
| 24 | + # github runs are only unique per repository and may also be re-run; create a |
| 25 | + # build id for the current run |
| 26 | + BUILD_ID: ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }} |
| 27 | + |
| 28 | +# cancel in progress builds for this workflow triggered by the same ref |
| 29 | +concurrency: |
| 30 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 31 | + cancel-in-progress: true |
| 32 | + |
| 33 | +jobs: |
| 34 | + build-linux-deb: |
| 35 | + # TODO test whether this builds on x86 too |
| 36 | + # XXX currently missing docker |
| 37 | + #runs-on: [self-hosted, x86] |
| 38 | + runs-on: [self-hosted, arm64, debbuilder] |
| 39 | + container: |
| 40 | + image: debian:trixie |
| 41 | + volumes: |
| 42 | + - /srv/gh-runners/quic-yocto/builds:/fileserver-builds |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + with: |
| 46 | + fetch-depth: 0 |
| 47 | + |
| 48 | + # make sure we have latest packages first, to get latest fixes, to avoid |
| 49 | + # an automated update while we're building, and to prevent version skews |
| 50 | + - name: Update OS packages |
| 51 | + run: | |
| 52 | + set -ux |
| 53 | + apt update |
| 54 | + apt -y upgrade |
| 55 | + apt -y full-upgrade |
| 56 | +
|
| 57 | + - name: Build Linux kernel deb for Qualcomm hardware |
| 58 | + run: | |
| 59 | + set -ux |
| 60 | + # install build-dependencies |
| 61 | + apt -y install git crossbuild-essential-arm64 make flex bison bc \ |
| 62 | + libelf-dev libssl-dev coreutils |
| 63 | + scripts/build-linux-deb.sh |
| 64 | +
|
| 65 | + - name: Upload results to fileserver |
| 66 | + run: | |
| 67 | + set -ux |
| 68 | + # curl will be used to talk to fileserver; should be installed by |
| 69 | + # default |
| 70 | + apt -y install curl |
| 71 | + # create directory for results on fileserver |
| 72 | + dir="/fileserver-builds/${BUILD_ID}" |
| 73 | + mkdir -vp "${dir}" |
| 74 | + # copy output files |
| 75 | + cp -av *.deb "${dir}" |
| 76 | + # instruct fileserver to publish this directory |
| 77 | + url="${FILESERVER_URL}/${BUILD_ID}/" |
| 78 | + curl -X POST -H 'Accept: text/event-stream' "${url}" |
| 79 | + # create files with directory and URL of these results |
| 80 | + echo "${dir}" >linux-deb.dir |
| 81 | + echo "${url}" >linux-deb.url |
| 82 | +
|
| 83 | + - name: Save URL of build results as an artifact |
| 84 | + uses: actions/upload-artifact@v4 |
| 85 | + with: |
| 86 | + path: linux-deb.dir |
| 87 | + path: linux-deb.url |
| 88 | + |
0 commit comments