Skip to content

Commit

Permalink
Add release test_progs build
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Yurin <[email protected]>
  • Loading branch information
yurinnick committed Dec 12, 2023
1 parent e1133cb commit 21fa7fb
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/scripts/matrix.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

from copy import deepcopy
from json import dumps
from enum import Enum
import os
Expand Down Expand Up @@ -72,13 +71,15 @@ def get_tests(config):
"arch": Arch.X86_64.value,
"toolchain": "llvm",
"llvm-version": "17",
"build_release": True,
},
{
"kernel": "LATEST",
"runs_on": [],
"arch": Arch.X86_64.value,
"toolchain": "llvm",
"llvm-version": "18",
"build_release": True,
},
{
"kernel": "LATEST",
Expand Down Expand Up @@ -115,6 +116,8 @@ def get_tests(config):

# Set run_veristat to false by default.
matrix[idx]["run_veristat"] = matrix[idx].get("run_veristat", False)
# Set build_release to false by default.
matrix[idx]["build_release"] = matrix[idx].get("build_release", False)
# Feel in the tests
matrix[idx]["tests"] = {
"include": [generate_test_config(test) for test in get_tests(matrix[idx])]
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/kernel-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ on:
type: boolean
description: Whether to download the linux sources into the working directory.
default: false
build_release:
required: true
type: boolean
description: Build selftests with -O2 optimization in addition to non-optimized build.
default: false
secrets:
AWS_ROLE_ARN:
required: true
Expand All @@ -60,7 +65,18 @@ jobs:
llvm-version: ${{ inputs.llvm-version }}
kernel: ${{ inputs.kernel }}
download_sources: ${{ inputs.download_sources }}

build-release:
if: ${{ inputs.build_release }}
uses: ./.github/workflows/kernel-build.yml
with:
arch: ${{ inputs.arch }}
toolchain_full: ${{ inputs.toolchain_full }}
toolchain: ${{ inputs.toolchain }}
runs_on: ${{ inputs.runs_on }}
llvm-version: ${{ inputs.llvm-version }}
kernel: ${{ inputs.kernel }}
download_sources: ${{ inputs.download_sources }}
release: true
test:
if: ${{ inputs.run_tests }}
uses: ./.github/workflows/kernel-test.yml
Expand Down Expand Up @@ -93,4 +109,4 @@ jobs:
aws_region: ${{ vars.AWS_REGION }}
runs_on: ${{ inputs.runs_on }}
secrets:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
15 changes: 12 additions & 3 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ on:
type: boolean
description: Whether to download the linux sources into the working directory.
default: false
release:
required: false
type: boolean
description: Build selftest with -O2 optimization
default: false


jobs:
build:
name: build for ${{ inputs.arch }} with ${{ inputs.toolchain_full }}
name: build for ${{ inputs.arch }} with ${{ inputs.toolchain_full }} ${{ inputs.release && 'and -O2 optimization' || '' }}
runs-on: ${{ fromJSON(inputs.runs_on) }}
timeout-minutes: 100
env:
Expand Down Expand Up @@ -103,6 +107,11 @@ jobs:
kbuild-output: ${{ env.KBUILD_OUTPUT }}
max-make-jobs: 32
llvm-version: ${{ inputs.llvm-version }}
env:
# RELEASE= disables all optimizaions
# RELEASE=0 adds -O0 make flag
# RELEASE=1 adds -O2 make flag
RELEASE: ${{ inputs.release && '1' || '' }}
- if: ${{ github.event_name != 'push' }}
name: Build samples
uses: libbpf/ci/build-samples@main
Expand All @@ -126,4 +135,4 @@ jobs:
with:
name: vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}
if-no-files-found: error
path: vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst
path: vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ jobs:
run_tests: ${{ github.event_name != 'push' }}
# Download sources
download_sources: ${{ github.repository == 'kernel-patches/vmtest' }}
build_release: ${{ matrix.build_release }}
secrets:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}

0 comments on commit 21fa7fb

Please sign in to comment.