Skip to content

Commit 8393257

Browse files
committed
Use workflow-call to share templates and runner config
1 parent 02e4737 commit 8393257

File tree

4 files changed

+106
-146
lines changed

4 files changed

+106
-146
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Kernels
1+
name: Kernel Build
22
on:
33
# Weekly auto-build
44
schedule:
@@ -15,87 +15,15 @@ on:
1515
type: boolean
1616
default: true
1717
required: true
18+
19+
# this job will publish images, and needs higher perms.
1820
permissions:
1921
contents: read
2022
packages: write
2123
id-token: write
22-
concurrency:
23-
group: "kernel-builder"
2424
jobs:
25-
matrix:
26-
name: matrix
27-
runs-on: ubuntu-latest
28-
steps:
29-
- name: Harden the runner (Audit all outbound calls)
30-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
31-
with:
32-
egress-policy: audit
33-
34-
- name: checkout repository
35-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
36-
with:
37-
submodules: recursive
38-
- name: install dependencies
39-
run: ./hack/build/install-matrix-deps.sh
40-
- name: generate matrix
41-
run: 'PATH="${HOME}/go/bin:${PATH}" ./hack/build/generate-matrix.sh "${{ inputs.spec }}"'
42-
- name: upload matrix
43-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
44-
with:
45-
name: matrix
46-
path: "matrix.json"
47-
compression-level: 0
48-
- name: capture matrix
49-
id: capture-matrix
50-
run: >
51-
echo "matrix=$(cat matrix.json)" >> "${GITHUB_OUTPUT}"
52-
outputs:
53-
matrix: "${{ steps.capture-matrix.outputs.matrix }}"
54-
build:
55-
name: "build ${{ matrix.builds.version }} ${{ matrix.builds.flavor }}"
56-
needs: matrix
57-
strategy:
58-
fail-fast: false
59-
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
60-
runs-on: "${{ matrix.builds.runner }}"
61-
env:
62-
KERNEL_PUBLISH: "${{ inputs.publish }}"
63-
KERNEL_VERSION: "${{ matrix.builds.version }}"
64-
KERNEL_SRC_URL: "${{ matrix.builds.source }}"
65-
FIRMWARE_URL: "${{ matrix.builds.firmware_url }}"
66-
FIRMWARE_SIG_URL: "${{ matrix.builds.firmware_sig_url }}"
67-
KERNEL_FLAVOR: "${{ matrix.builds.flavor }}"
68-
KERNEL_TAGS: "${{ join(matrix.builds.tags, ',') }}"
69-
KERNEL_ARCHITECTURES: "${{ join(matrix.builds.architectures, ',') }}"
70-
steps:
71-
- name: Harden the runner (Audit all outbound calls)
72-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
73-
with:
74-
egress-policy: audit
75-
76-
- name: checkout repository
77-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
78-
with:
79-
submodules: recursive
80-
- name: install cosign
81-
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
82-
- name: docker setup linux-kernel-oci
83-
run: sudo python3 ./hack/build/docker-setup.py
84-
- name: docker setup buildx
85-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
86-
- name: docker login ghcr.io
87-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
88-
with:
89-
registry: ghcr.io
90-
username: "${{github.actor}}"
91-
password: "${{secrets.GITHUB_TOKEN}}"
92-
- name: generate docker script
93-
run: "./hack/build/generate-docker-script.sh"
94-
- name: upload docker script
95-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
96-
with:
97-
name: "build-${{ matrix.builds.version }}-${{ matrix.builds.flavor }}.sh"
98-
path: "docker.sh"
99-
compression-level: 0
100-
- name: run docker script
101-
run: sh -x docker.sh
25+
test:
26+
uses: ./.github/workflows/matrix.yml
27+
with:
28+
spec: inputs.spec
29+
publish: inputs.publish

.github/workflows/matrix.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build Kernel Matrix
2+
on:
3+
workflow_call:
4+
inputs:
5+
spec:
6+
description: 'Build Specification'
7+
type: string
8+
default: "new"
9+
required: true
10+
publish:
11+
description: 'Publish Builds'
12+
type: boolean
13+
default: true
14+
required: true
15+
concurrency:
16+
group: "kernel-builder"
17+
jobs:
18+
matrix:
19+
name: matrix
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
24+
with:
25+
egress-policy: audit
26+
27+
- name: checkout repository
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
29+
with:
30+
submodules: recursive
31+
- name: install dependencies
32+
run: ./hack/build/install-matrix-deps.sh
33+
- name: generate matrix
34+
run: 'PATH="${HOME}/go/bin:${PATH}" ./hack/build/generate-matrix.sh "${{ inputs.spec }}"'
35+
- name: upload matrix
36+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
37+
with:
38+
name: matrix
39+
path: "matrix.json"
40+
compression-level: 0
41+
- name: capture matrix
42+
id: capture-matrix
43+
run: >
44+
echo "matrix=$(cat matrix.json)" >> "${GITHUB_OUTPUT}"
45+
outputs:
46+
matrix: "${{ steps.capture-matrix.outputs.matrix }}"
47+
build:
48+
name: "build ${{ matrix.builds.version }} ${{ matrix.builds.flavor }}"
49+
needs: matrix
50+
strategy:
51+
fail-fast: false
52+
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
53+
runs-on: "${{ matrix.builds.runner }}"
54+
env:
55+
KERNEL_PUBLISH: "${{ inputs.publish }}"
56+
KERNEL_VERSION: "${{ matrix.builds.version }}"
57+
KERNEL_SRC_URL: "${{ matrix.builds.source }}"
58+
FIRMWARE_URL: "${{ matrix.builds.firmware_url }}"
59+
FIRMWARE_SIG_URL: "${{ matrix.builds.firmware_sig_url }}"
60+
KERNEL_FLAVOR: "${{ matrix.builds.flavor }}"
61+
KERNEL_TAGS: "${{ join(matrix.builds.tags, ',') }}"
62+
KERNEL_ARCHITECTURES: "${{ join(matrix.builds.architectures, ',') }}"
63+
steps:
64+
- name: Harden the runner (Audit all outbound calls)
65+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
66+
with:
67+
egress-policy: audit
68+
69+
- name: checkout repository
70+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
71+
with:
72+
submodules: recursive
73+
- name: install cosign
74+
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
75+
- name: docker setup linux-kernel-oci
76+
run: sudo python3 ./hack/build/docker-setup.py
77+
- name: docker setup buildx
78+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
79+
- name: docker login ghcr.io
80+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
81+
with:
82+
registry: ghcr.io
83+
username: "${{github.actor}}"
84+
password: "${{secrets.GITHUB_TOKEN}}"
85+
- name: generate docker script
86+
run: "./hack/build/generate-docker-script.sh"
87+
- name: upload docker script
88+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
89+
with:
90+
name: "build-${{ matrix.builds.version }}-${{ matrix.builds.flavor }}.sh"
91+
path: "docker.sh"
92+
compression-level: 0
93+
- name: run docker script
94+
run: sh -x docker.sh

.github/workflows/test.yml

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,69 +7,8 @@ on:
77
permissions:
88
contents: read
99
packages: read
10-
env:
11-
TEST_MATRIX_SPEC: "only-latest:flavor=host,zone,zone-nvidiagpu"
1210
jobs:
1311
test:
14-
name: test
15-
runs-on: edera-large
16-
env:
17-
FIRMWARE_URL: "https://cdn.kernel.org/pub/linux/kernel/firmware/linux-firmware-20250410.tar.xz"
18-
FIRMWARE_SIG_URL: "https://cdn.kernel.org/pub/linux/kernel/firmware/linux-firmware-20250410.tar.sign"
19-
KERNEL_ARCHITECTURES: "x86_64"
20-
steps:
21-
- name: Harden the runner (Audit all outbound calls)
22-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
23-
with:
24-
egress-policy: audit
25-
26-
- name: checkout repository
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
28-
with:
29-
submodules: recursive
30-
- name: install dependencies
31-
run: ./hack/build/install-matrix-deps.sh
32-
- name: generate spec-new matrix
33-
run: 'PATH="${HOME}/go/bin:${PATH}" KERNEL_BUILD_SPEC="new" ./hack/build/generate-matrix.sh'
34-
- name: upload spec-new matrix
35-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
36-
with:
37-
name: spec-new-matrix
38-
path: "matrix.json"
39-
compression-level: 0
40-
- name: generate spec-rebuild matrix
41-
run: 'PATH="${HOME}/go/bin:${PATH}" KERNEL_BUILD_SPEC="rebuild" ./hack/build/generate-matrix.sh'
42-
- name: upload spec-rebuild matrix
43-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
44-
with:
45-
name: spec-rebuild-matrix
46-
path: "matrix.json"
47-
compression-level: 0
48-
- name: generate test matrix
49-
run: 'PATH="${HOME}/go/bin:${PATH}" ./hack/build/generate-matrix.sh "${TEST_MATRIX_SPEC}"'
50-
- name: upload test matrix
51-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
52-
with:
53-
name: test-matrix
54-
path: "matrix.json"
55-
compression-level: 0
56-
- name: docker setup linux-kernel-oci
57-
run: sudo python3 ./hack/build/docker-setup.py
58-
- name: docker setup buildx
59-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
60-
- name: docker login ghcr.io
61-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
62-
with:
63-
registry: ghcr.io
64-
username: "${{github.actor}}"
65-
password: "${{secrets.GITHUB_TOKEN}}"
66-
- name: generate docker script
67-
run: "./hack/build/generate-docker-script.sh matrix.json"
68-
- name: upload docker script
69-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
70-
with:
71-
name: "docker.sh"
72-
path: "docker.sh"
73-
compression-level: 0
74-
- name: run docker script
75-
run: sh -x docker.sh
12+
uses: ./.github/workflows/matrix.yml
13+
with:
14+
spec: "only-latest:flavor=host,zone,zone-nvidiagpu"

config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ flavors:
2020
- 'nvidia-575.64.03'
2121
- 'nvidia-575.57.08'
2222
constraints:
23-
series:
24-
- '6.15'
23+
lower: '6.15'
2524
- name: zone-openpax
2625
constraints:
2726
series:

0 commit comments

Comments
 (0)