Skip to content

Commit bf52cf0

Browse files
committed
Add build and test all workflow
1 parent cd3cdf5 commit bf52cf0

File tree

5 files changed

+98
-67
lines changed

5 files changed

+98
-67
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Test All
2+
on: [push, pull_request, workflow_call, workflow_dispatch]
3+
4+
jobs:
5+
build:
6+
uses: ./.github/workflows/build2.yml
7+
strategy:
8+
matrix:
9+
kernel: [{ack: 0, version: 5.10.y}, {ack: 0, version: 5.15.y}, {ack: 0, version: 6.1.y}, {ack: 0, version: 6.6.y}, {ack: 1, version: android13-5.10-lts}, {ack: 1, version: android14-5.15-lts}]
10+
arch: [arm64, x86_64]
11+
with:
12+
host-os: ubuntu-20.04
13+
ack: ${{ matrix.kernel.ack }}
14+
arch: ${{ matrix.arch }}
15+
version: ${{ matrix.kernel.version }}
16+
17+
rootfs:
18+
uses: ./.github/workflows/rootfs.yml
19+
strategy:
20+
matrix:
21+
arch: [arm64, x86_64]
22+
with:
23+
host-os: ubuntu-22.04
24+
arch: ${{ matrix.arch }}
25+
26+
build-and-test:
27+
uses: ./.github/workflows/build-and-test.yml
28+
needs: rootfs
29+
strategy:
30+
matrix:
31+
kernel: [{ack: 0, version: 5.10.y}, {ack: 0, version: 5.15.y}, {ack: 0, version: 6.1.y}, {ack: 0, version: 6.6.y}, {ack: 1, version: android13-5.10-lts}, {ack: 1, version: android14-5.15-lts}]
32+
arch: [arm64, x86_64]
33+
with:
34+
host-os: ubuntu-22.04
35+
ack: ${{ matrix.kernel.ack }}
36+
arch: ${{ matrix.arch }}
37+
version: ${{ matrix.kernel.version }}

.github/workflows/build-and-test.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: Build And Test
22
on:
3-
# push:
4-
# pull_request:
53
workflow_dispatch:
64
inputs:
75
host-os:

.github/workflows/release.yml

+58-36
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,61 @@
11
name: Release
2-
on:
3-
push:
4-
workflow_dispatch:
2+
on: [workflow_dispatch]
53

64
jobs:
7-
build:
8-
uses: ./.github/workflows/build2.yml
9-
strategy:
10-
matrix:
11-
kernel: [{ack: 0, version: 5.10.y}, {ack: 0, version: 5.15.y}, {ack: 0, version: 6.1.y}, {ack: 0, version: 6.6.y}, {ack: 1, version: android13-5.10-lts}, {ack: 1, version: android14-5.15-lts}]
12-
arch: [arm64, x86_64]
13-
with:
14-
host-os: ubuntu-20.04
15-
ack: ${{ matrix.kernel.ack }}
16-
arch: ${{ matrix.arch }}
17-
version: ${{ matrix.kernel.version }}
18-
19-
rootfs:
20-
uses: ./.github/workflows/rootfs.yml
21-
strategy:
22-
matrix:
23-
arch: [arm64, x86_64]
24-
with:
25-
host-os: ubuntu-22.04
26-
arch: ${{ matrix.arch }}
27-
28-
build-and-test:
29-
uses: ./.github/workflows/build-and-test.yml
30-
needs: rootfs
31-
strategy:
32-
matrix:
33-
kernel: [{ack: 0, version: 5.10.y}, {ack: 0, version: 5.15.y}, {ack: 0, version: 6.1.y}, {ack: 0, version: 6.6.y}, {ack: 1, version: android13-5.10-lts}, {ack: 1, version: android14-5.15-lts}]
34-
arch: [arm64, x86_64]
35-
with:
36-
host-os: ubuntu-22.04
37-
ack: ${{ matrix.kernel.ack }}
38-
arch: ${{ matrix.arch }}
39-
version: ${{ matrix.kernel.version }}
5+
build-and-test-all:
6+
uses: ./.github/workflows/build-and-test-all.yml
7+
release:
8+
runs-on: ubuntu-22.04
9+
needs: [build-and-test-all]
10+
permissions:
11+
contents: write
12+
steps:
13+
14+
- name: Download kernel artifacts
15+
uses: actions/download-artifact@v4
16+
with:
17+
name: kernel-artifacts
18+
pattern: kernel-artifacts-*
19+
merge-multiple: true
20+
21+
- name: Download rootfs artifacts
22+
uses: actions/download-artifact@v4
23+
with:
24+
name: rootfs
25+
pattern: rootfs-*
26+
merge-multiple: true
27+
28+
- run: ls -lR
29+
30+
- name: Compute hashsums and create hashsums.txt
31+
shell: bash
32+
run: |
33+
shopt -s extglob
34+
(cd kernel-artifacts && sha256sum !(*.deb)) > hashsums.txt
35+
(cd rootfs && sha256sum *) >> hashsums.txt
36+
37+
- name: Set output variables
38+
id: vars
39+
run: |
40+
set -x
41+
42+
echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
43+
44+
- name: Publish release
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
prerelease: true
48+
tag_name: ${{ steps.vars.outputs.DATE }}-${{ needs.build.outputs.SHORT_HASH }}
49+
files: |
50+
kernel-artifacts/vmlinux*
51+
kernel-artifacts/Image*
52+
kernel-artifacts/bzImage*
53+
rootfs/*
54+
hashsums.txt
55+
56+
- name: Publish header release
57+
uses: softprops/action-gh-release@v2
58+
with:
59+
prerelease: true
60+
tag_name: linux-headers-${{ steps.vars.outputs.DATE }}-${{ needs.build.outputs.SHORT_HASH }}
61+
files: kernel-artifacts/linux-headers-*.deb

.github/workflows/rootfs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ on:
2525
arch:
2626
required: true
2727
type: string
28+
# TODO: Actually use this
2829
cache:
2930
required: false
3031
type: boolean
@@ -36,7 +37,7 @@ jobs:
3637
outputs:
3738
cache-hit: ${{ steps.cache-check.outputs.cache-hit }}
3839
steps:
39-
- name: Cache kernel image
40+
- name: Check cache for rootfs
4041
id: cache-check
4142
uses: actions/cache/restore@v4
4243
with:

.github/workflows/test.yml

+1-28
Original file line numberDiff line numberDiff line change
@@ -49,34 +49,13 @@ jobs:
4949

5050
- run: ls -lR
5151

52-
# - name: Install common dependencies
53-
# run: sudo apt update && sudo apt install -y debootstrap
54-
5552
- name: Install x86_64 dependencies
5653
if: ${{ inputs.arch == 'x86_64' }}
5754
run: sudo apt update && sudo apt install -y qemu-system-x86
5855

5956
- name: Install arm64 dependencies
6057
if: ${{ inputs.arch == 'arm64' }}
61-
run: sudo apt update && sudo apt install -y qemu-system-arm # qemu-user-static binfmt-support
62-
63-
# - name: Initialize rootfs and initramfs
64-
# shell: bash
65-
# run: |
66-
# set -x
67-
68-
# make rootfs-init
69-
70-
# ALPINE_ROOTFS=alpine-${{ inputs.arch }}.img
71-
# UBUNTU_ROOTFS=ubuntu-jammy-${{ inputs.arch }}.img
72-
73-
# ROOTFS=${ALPINE_ROOTFS} make rootfs-init
74-
75-
# scripts/ubuntu_debootstrap.sh jammy ${{ inputs.arch }}
76-
# SUDO=1 ROOTFS_DIR=./rootfs/ubuntu-jammy-${{ inputs.arch }} CPIO_FILE=ubuntu-jammy-${{ inputs.arch }}.cpio.gz make rootfs-overlay
77-
78-
# echo "ALPINE_ROOTFS=$ALPINE_ROOTFS" >> $GITHUB_OUTPUT
79-
# echo "UBUNTU_ROOTFS=$UBUNTU_ROOTFS" >> $GITHUB_OUTPUT
58+
run: sudo apt update && sudo apt install -y qemu-system-arm
8059

8160
- name: Setup shared/init.sh
8261
run: |
@@ -109,9 +88,3 @@ jobs:
10988
11089
# Run with alpine rootfs in non-standard location, with additional options
11190
CPU=2 MEM=2048M QEMU_EXTRA_ARGS="" QEMU_EXTRA_KERNEL_CMDLINE="nokaslr" ROOTFS=./${ALPINE_ROOTFS} make run
112-
113-
# - name: Upload rootfs artifact
114-
# uses: actions/upload-artifact@v4
115-
# with:
116-
# name: rootfs-${{ inputs.SUFFIX }}
117-
# path: rootfs/${{ env.ALPINE_ROOTFS }}

0 commit comments

Comments
 (0)