forked from qualcomm-linux/qcom-deb-images
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (140 loc) · 5.22 KB
/
linux.yml
File metadata and controls
152 lines (140 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Build Linux kernel deb and debos image
on:
workflow_call:
inputs:
kernel_name:
description: 'Name of the kernel to build (default: mainline)'
required: false
type: string
default: 'mainline'
debos_extra_args:
description: Extra arguments to pass to debos (e.g. -t dtb:qcom/some.dtb)
required: false
type: string
default: ''
build_linux_deb_extra_args:
description: Extra arguments to pass to build-linux-deb.py
required: false
type: string
default: ''
skip_qemu_tests:
description: Skip QEMU tests
required: false
type: boolean
default: false
skip_lava_tests:
description: Skip LAVA tests
required: false
type: boolean
default: false
# allow manual runs
workflow_dispatch:
inputs:
kernel_name:
description: 'Name of the kernel to build (default: mainline)'
required: false
type: string
debos_extra_args:
description: Extra arguments to pass to debos (e.g. -t dtb:qcom/some.dtb)
required: false
type: string
build_linux_deb_extra_args:
description: Extra arguments to pass to build-linux-deb.py
required: false
type: string
# implicitely set all other permissions to none
permissions:
checks: write # lava-test.yml
contents: read # actions/checkout debos.yml lava-test.yml
packages: read # lava-test.yml
pull-requests: write # lava-test.yml
env:
# github runs are only unique per repository and may also be re-run; create a
# build id for the current run
BUILD_ID: ${{ github.event.repository.name }}-${{ github.run_id }}-${{ github.run_attempt }}
# name of the kernel being built
KERNEL_NAME: ${{ inputs.kernel_name || 'mainline' }}
# extra args to pass to build-linux-deb.py
BUILD_LINUX_DEB_EXTRA_ARGS: ${{ inputs.build_linux_deb_extra_args }}
# cancel in progress builds for this workflow triggered by the same ref
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.kernel_name || 'mainline' }}
cancel-in-progress: true
jobs:
build-linux-deb:
# don't run cron from forks of the main repository or from other branches
if: github.repository == 'qualcomm-linux/qcom-deb-images' && github.ref == 'refs/heads/main'
# for cross-builds
runs-on: [self-hosted, qcom-u2404, amd64]
# alternative for native builds, but overkill to do both
#runs-on: [self-hosted, qcom-u2404, arm64]
container:
image: public.ecr.aws/debian/debian:trixie
volumes:
- /efs/qli/qcom-deb-images:/efs
steps:
- uses: actions/checkout@v6
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 \
libdw-dev libelf-dev libssl-dev libssl-dev:arm64 dpkg-dev \
debhelper kmod python3 rsync coreutils
scripts/build-linux-deb.py ${BUILD_LINUX_DEB_EXTRA_ARGS} \
`ls kernel-configs/*.config | sort` \
- name: Stage artifacts for upload
run: |
set -ux
# dcmd from devscripts will be used to parse .changes file
apt -y install --no-install-recommends devscripts
# stage artifacts in a directory
mkdir -v artifacts
cp -av `dcmd *.changes` artifacts
- name: Upload results to EFS
run: |
set -ux
export BUILD_DIR="/efs/${BUILD_ID}"
mkdir -vp "${BUILD_DIR}"
cp -av artifacts/* "${BUILD_DIR}"
# create or update symlink
ln -fnsv "${BUILD_ID}" "/efs/${KERNEL_NAME}"
# perhaps help NFS sync
sync
- name: Upload private artifacts
uses: qualcomm-linux/upload-private-artifact-action@aws-v4
id: upload_artifacts
with:
path: artifacts
# these should be the defaults; or ought to reuse BUILD_ID
s3_bucket: qcom-prd-gh-artifacts
destination: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.run_id }}-${{ github.run_attempt }}/
debos-linux-deb:
needs: build-linux-deb
uses: ./.github/workflows/debos.yml
with:
kernelpackage: efs/${{ inputs.kernel_name || 'mainline' }}
debos_extra_args: ${{ inputs.debos_extra_args }}
skip_qemu_tests: ${{ inputs.skip_qemu_tests || false }}
test-linux-deb:
if: ${{ !inputs.skip_lava_tests }}
uses: ./.github/workflows/lava-test.yml
needs: debos-linux-deb
secrets: inherit
with:
url: ${{ needs.debos-linux-deb.outputs.artifacts_url }}