Skip to content

Commit 0c1d4e4

Browse files
authored
Add Nightly Kernel Build Workflow with Weekly Artifact Upload (#281)
## Summary This PR adds a new GitHub Actions workflow that performs a weekly kernel build using the FastRPC Docker image. The workflow automatically builds the Linux kernel from the `qcom-next` branch of the `qualcomm-linux/kernel` repository and uploads the generated artifacts. ## Key Features - Weekly scheduled run (`cron: 0 0 * * 0`) - Builds kernel using custom FastRPC Docker environment - Zips and uploads all build artifacts for downstream testing - Ensures automated, consistent kernel snapshots for validation ## Verification The workflow has been successfully tested and verified in the staging environment. You can review the successful run here: 🔗 **Staging Run:** https://github.com/qualcomm-linux-stg/fastrpc/actions/runs/21269727139 ## Why This Change? - Provides regular kernel builds aligned with upstream changes - Enables automated testing and faster detection of regressions - Ensures stable and reproducible artifact availability for the team ## Notes - Workflow triggers automatically every Sunday at midnight UTC - No changes to existing workflows or build logic outside this addition
2 parents 3ac74f6 + eeb9d5b commit 0c1d4e4

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

.github/nightly-kernel-build.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Nightly Build kernel and upload artifacts
2+
# This workflow builds the Linux kernel nightly from the `qcom-next` branch
3+
# of the `qualcomm-linux/kernel` repository using a custom Docker image.
4+
# Artifacts are zipped and uploaded for 30 days retention.
5+
6+
name: Nightly Build kernel and upload artifacts
7+
8+
on:
9+
schedule:
10+
- cron: '0 0 * * 0' # Runs every Sunday at midnight UTC
11+
workflow_dispatch: # Allows manual trigger
12+
13+
jobs:
14+
build-and-upload:
15+
runs-on:
16+
group: GHA-fastrpc-Prd-SelfHosted-RG
17+
labels: [ self-hosted, fastrpc-prd-u2404-x64-large-od-ephem ]
18+
steps:
19+
# Checkout fastrpc-image repository to get the Dockerfile
20+
- name: Checkout fastrpc-image repo for Dockerfile
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
repository: qualcomm/fastrpc-image
25+
ref: main
26+
27+
- name: Build fastrpc docker image
28+
run: |
29+
docker build -t fastrpc-image:latest -f Dockerfile .
30+
31+
- name: Configure git
32+
shell: bash
33+
run: |
34+
git config --global user.name "github-actions"
35+
git config --global user.email "github-actions@github.com"
36+
37+
- name: Clone kernel repository
38+
shell: bash
39+
run: |
40+
echo "Cloning qualcomm-linux/kernel into ${{ github.workspace }}/kernel..."
41+
git clone https://github.com/qualcomm-linux/kernel.git "${{ github.workspace }}/kernel"
42+
cd "${{ github.workspace }}/kernel"
43+
echo "Fetching all branches and checking out 'qcom-next'..."
44+
git fetch origin
45+
git checkout qcom-next
46+
echo "Successfully checked out qcom-next branch."
47+
48+
- name: Build kernel
49+
shell: bash
50+
run: |
51+
echo "Creating kobj directory for out-of-tree build output..."
52+
mkdir -p "${{ github.workspace }}/kobj"
53+
echo "Running Docker container to build the kernel..."
54+
docker run -i --rm \
55+
--user "$(id -u):$(id -g)" \
56+
--volume "${{ github.workspace }}:/workspace" \
57+
--workdir="/workspace/kernel" \
58+
fastrpc-image:latest bash -c "
59+
echo 'Inside container: Current working directory is $(pwd)'
60+
echo 'Inside container: Building kernel with output directory O=/workspace/kobj'
61+
make O=/workspace/kobj defconfig
62+
make O=/workspace/kobj -j\$(nproc) all
63+
make O=/workspace/kobj -j\$(nproc) dir-pkg INSTALL_MOD_STRIP=1
64+
"
65+
echo "Kernel build completed. Checking for kobj output..."
66+
ls -l "${{ github.workspace }}/kobj" || echo "kobj directory is empty or missing."
67+
68+
- name: Zip kobj folder
69+
shell: bash
70+
run: |
71+
mkdir -p build_output
72+
if [ -d "${{ github.workspace }}/kobj" ]; then
73+
echo "zipping kobj to build_output/kobj.tar.gz..."
74+
tar -cvf build_output/kobj.tar -C "${{ github.workspace }}" kobj
75+
gzip -9 build_output/kobj.tar
76+
echo "Successfully created build_output/kobj.tar.gz"
77+
else
78+
echo "Error: kobj directory not found."
79+
exit 1
80+
fi
81+
82+
- name: Upload zipped kobj as artifact to aws S3 bucket
83+
uses: qualcomm/fastrpc/.github/actions/aws_s3_helper@development
84+
with:
85+
s3_bucket: qli-prd-fastrpc-gh-artifacts
86+
local_file: ${{ github.workspace }}/build_output/kobj.tar.gz
87+
mode: single-upload
88+
deviceTree: false

0 commit comments

Comments
 (0)