Skip to content

ci: Move to new self-hosted runners #31

ci: Move to new self-hosted runners

ci: Move to new self-hosted runners #31

Workflow file for this run

name: Build Linux kernel deb
on:
pull_request:
branches: [main]
# run weekly on Monday at 8:30am
schedule:
- cron: '30 8 * * 1'
# allow manual runs
workflow_dispatch:
# only need permission to read repository; implicitely set all other
# permissions to none
permissions:
contents: read
security-events: read # This is required to handle authentication to our artifact publishing API
env:
# where results will be posted/hosted
FILESERVER_URL: https://quic-yocto-fileserver-1029608027416.us-central1.run.app
# github runs are only unique per repository and may also be re-run; create a
# build id for the current run
BUILD_ID: ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}
# cancel in progress builds for this workflow triggered by the same ref
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux-deb:
# for cross-builds
runs-on: [self-hosted, qcom-u2404, amd64]
# alternative for native builds, but overkill to do both
#runs-on: [self-hosted, arm64, debbuilder]
container:
image: debian:trixie
volumes:
- /efs/qli/metaqcom/gh-runners/quic-yocto/builds:/fileserver-builds
- /efs/qli/metaqcom/gh-runners/quic-yocto/downloads:/fileserver-downloads
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# make sure we have latest packages first, to get latest fixes, to avoid
# an automated update while we're building, and to prevent version skews
- name: Update OS packages
run: |
set -ux
apt update
apt -y upgrade
apt -y full-upgrade
- name: Build Linux kernel deb
run: |
set -ux
# download arm64 package lists to install cross build-dependencies
if [ "$(dpkg --print-architecture)" != arm64 ]; then
dpkg --add-architecture arm64
apt update
fi
# install build-dependencies; TODO: --no-install-recommends
apt -y install git crossbuild-essential-arm64 make flex bison bc \
libelf-dev libssl-dev libssl-dev:arm64 dpkg-dev \
debhelper-compat kmod python3 rsync coreutils
scripts/build-linux-deb.sh kernel-configs/systemd-boot.config
- name: Upload results to fileserver
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ux
# dcmd from devscripts will be used to parse .changes file
apt -y install --no-install-recommends devscripts
# python3-requests is used by publish_aritfacts.py
apt -y install python3-requests
# copy to fileserver builds and downloads directories
export BUILD_DIR="/fileserver-downloads/${BUILD_ID}"
mkdir -vp "${BUILD_DIR}"
cp -av `dcmd *.changes` "${BUILD_DIR}"
# create or update linux-deb-latest symlink
mkdir -vp /fileserver-downloads/qcom-deb-images
(
cd /fileserver-downloads/qcom-deb-images
# remove what used to be a directory and create/update symlink to
# point to latest build
rm -rvf linux-latest
rm -rvf linux-deb-latest
ln -svf "../${BUILD_ID}" linux-deb-latest
)
# perhaps help NFS sync
sync
# instruct fileserver to publish this directory
export URL="${FILESERVER_URL}/${BUILD_ID}/"
.github/workflows/publish_artifacts.py
echo Image available at: ${URL}