Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/actions/cache-restore/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Restore Build Caches'
description: 'Restore dl/ and .ccache/ caches for Buildroot builds'
inputs:
target:
description: 'Build target for cache key differentiation'
required: true
dl-prefix:
description: 'Prefix for dl/ cache key (e.g., "dl", "dl-boot")'
required: false
default: 'dl'
ccache-prefix:
description: 'Prefix for .ccache/ cache key (e.g., "ccache", "ccache-boot")'
required: false
default: 'ccache'
enabled:
description: 'Set to false to skip cache restoration'
required: false
default: 'true'
runs:
using: 'composite'
steps:
- name: Restore Cache of dl/
if: ${{ inputs.enabled == 'true' }}
uses: actions/cache@v4
with:
path: dl/
key: ${{ inputs.dl-prefix }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
${{ inputs.dl-prefix }}-
dl-

- name: Restore Cache of .ccache/
if: ${{ inputs.enabled == 'true' }}
uses: actions/cache@v4
with:
path: .ccache/
key: ${{ inputs.ccache-prefix }}-${{ inputs.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
${{ inputs.ccache-prefix }}-${{ inputs.target }}-
${{ inputs.ccache-prefix }}-
ccache-
15 changes: 15 additions & 0 deletions .github/actions/podman-cleanup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Podman Cleanup'
description: 'Clean up stale podman state from previous runs'
runs:
using: 'composite'
steps:
- name: Cleanup podman state
shell: bash
run: |
set -x
podman ps -a || true
podman stop -a || true
podman rm -a -f || true
podman volume prune -f || true
podman system prune -a -f || true
podman system migrate || true
22 changes: 5 additions & 17 deletions .github/workflows/build-boot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- cn9130_crb_boot
- fireant_boot
- nanopi_r2s_boot
- rpi2_boot
- rpi64_boot
env:
MAKEFLAGS: -j5
Expand Down Expand Up @@ -63,24 +64,11 @@ jobs:

echo "Building ${defconfig}_defconfig, version ${version}-${rev}, artifact ${archive} ..."

- name: Restore Cache of dl/
uses: actions/cache@v4
- uses: ./.github/actions/cache-restore
with:
path: dl/
key: dl-boot-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-boot-
dl-

- name: Restore Cache of .ccache/
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-boot-${{ matrix.defconfig }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-boot-${{ matrix.defconfig }}-
ccache-boot-
ccache-
target: ${{ matrix.defconfig }}
dl-prefix: dl-boot
ccache-prefix: ccache-boot

- name: Configure ${{ matrix.defconfig }}_defconfig
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
type: choice
required: true
options:
- raspberrypi-rpi2
- raspberrypi-rpi64
- bananapi-bpi-r3
- friendlyarm-nanopi-r2s
Expand Down Expand Up @@ -49,6 +50,11 @@ jobs:
- name: Set bootloader and target based on board
run: |
case "${{ inputs.board }}" in
raspberrypi-rpi2)
echo "BOOTLOADER=rpi2-boot" >> $GITHUB_ENV
echo "ARCH=arm" >> $GITHUB_ENV
echo "BUILD_EMMC=false" >> $GITHUB_ENV
;;
raspberrypi-rpi64)
echo "BOOTLOADER=rpi64-boot" >> $GITHUB_ENV
echo "ARCH=aarch64" >> $GITHUB_ENV
Expand Down
34 changes: 6 additions & 28 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,16 @@ jobs:
runs-on: [self-hosted, release]
strategy:
matrix:
target: [aarch64, x86_64]
target: [aarch64, arm, x86_64]
fail-fast: false
steps:
- name: Cleanup podman state
run: |
set -x
podman ps -a || true
podman stop -a || true
podman rm -a -f || true
podman volume prune -f || true
podman system prune -a -f || true
podman system migrate || true

- uses: actions/checkout@v4
with:
clean: true
submodules: recursive

- uses: ./.github/actions/podman-cleanup

- name: Set Release Variables
id: vars
run: |
Expand All @@ -48,24 +40,10 @@ jobs:
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT

- name: Restore Cache of dl/
if: ${{ inputs.use_cache }}
uses: actions/cache@v4
with:
path: dl/
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-

- name: Restore Cache of .ccache/
if: ${{ inputs.use_cache }}
uses: actions/cache@v4
- uses: ./.github/actions/cache-restore
with:
path: .ccache/
key: ccache-${{ matrix.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ matrix.target }}-
ccache-
target: ${{ matrix.target }}
enabled: ${{ inputs.use_cache }}

- name: Configure & Build
env:
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ jobs:
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Cleanup podman state
run: |
set -x
podman ps -a || true
podman stop -a || true
podman rm -a -f || true
podman volume prune -f || true
podman system prune -a -f || true
podman system migrate || true

- name: Checkout infix repo
uses: actions/checkout@v4
Expand All @@ -98,6 +89,8 @@ jobs:
submodules: recursive
token: ${{ secrets.CHECKOUT_TOKEN || github.token }}

- uses: ./.github/actions/podman-cleanup

- name: Run pre-build script
if: ${{ inputs.pre_build_script != '' }}
run: |
Expand Down Expand Up @@ -127,22 +120,9 @@ jobs:
echo "tgz=${name}-${target}.tar.gz" >> $GITHUB_OUTPUT
echo "Building target ${target}_defconfig"

- name: Restore Cache of dl/
uses: actions/cache@v4
with:
path: dl/
key: dl-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-

- name: Restore Cache of .ccache/
uses: actions/cache@v4
- uses: ./.github/actions/cache-restore
with:
path: .ccache/
key: ccache-${{ env.TARGET }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-${{ env.TARGET }}-
ccache-
target: ${{ env.TARGET }}

- name: Configure ${{ env.TARGET }}
run: |
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore Cache of dl/
uses: actions/cache@v4
- uses: ./.github/actions/cache-restore
with:
path: dl/
key: dl-netconf-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-netconf-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-x86_64-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-x86_64-
ccache-
target: x86_64
dl-prefix: dl-netconf
- name: Disk inventory (2/2) ...
run: |
echo "df -h ========================================================================="
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,12 @@ jobs:
contents: write
discussions: write
steps:
- name: Cleanup podman state
run: |
set -x
podman ps -a || true
podman stop -a || true
podman rm -a -f || true
podman volume prune -f || true
podman system prune -a -f || true
podman system migrate || true

- uses: actions/checkout@v4
with:
submodules: 'true'

- uses: ./.github/actions/podman-cleanup

- name: Set Release Variables
id: rel
run: |
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ jobs:
name: Regression Test ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }} ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }}
runs-on: [self-hosted, regression]
steps:
- name: Cleanup podman state
run: |
set -x
podman ps -a || true
podman stop -a || true
podman rm -a -f || true
podman volume prune -f || true
podman system prune -a -f || true
podman system migrate || true

- name: Checkout infix repo
uses: actions/checkout@v4
with:
Expand All @@ -80,6 +70,8 @@ jobs:
submodules: recursive
token: ${{ secrets.CHECKOUT_TOKEN || github.token }}

- uses: ./.github/actions/podman-cleanup

- name: Run pre-test script
if: ${{ inputs.pre_test_script != '' }}
run: |
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Kernelkit Trigger
name: CI

on:
pull_request:
Expand Down Expand Up @@ -28,6 +28,7 @@ jobs:
outputs:
x86_64_target: ${{ steps.set-targets.outputs.x86_64_target }}
aarch64_target: ${{ steps.set-targets.outputs.aarch64_target }}
arm_target: ${{ steps.set-targets.outputs.arm_target }}
steps:
- run: |
echo "Triggering build, logging meta data ..."
Expand All @@ -43,9 +44,11 @@ jobs:
| grep -q "ci:main"; then
echo "x86_64_target=x86_64_minimal" >> $GITHUB_OUTPUT
echo "aarch64_target=aarch64_minimal" >> $GITHUB_OUTPUT
echo "arm_target=arm_minimal" >> $GITHUB_OUTPUT
else
echo "x86_64_target=x86_64" >> $GITHUB_OUTPUT
echo "aarch64_target=aarch64" >> $GITHUB_OUTPUT
echo "arm_target=arm" >> $GITHUB_OUTPUT
fi

build-x86_64:
Expand All @@ -62,6 +65,13 @@ jobs:
name: "infix"
target: ${{ needs.check-trigger.outputs.aarch64_target }}

build-arm:
needs: check-trigger
uses: ./.github/workflows/build.yml
with:
name: "infix"
target: ${{ needs.check-trigger.outputs.arm_target }}

test-run-x86_64:
needs: [check-trigger, build-x86_64]
uses: ./.github/workflows/test.yml
Expand Down
Empty file added board/arm/rootfs/.empty
Empty file.
3 changes: 2 additions & 1 deletion test/case/interfaces/tunnel_basic/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def __init__(self):
"address": [{
"ip": "2001:db8:3c4d:30::1",
"prefix-length": 64
}]
}],
"forwarding": True
},
CONTAINER_TYPE: container_left6
}]
Expand Down
7 changes: 4 additions & 3 deletions test/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ endif

test:
$(test-dir)/env -r $(base) $(mode) $(binaries) $(pkg-$(ARCH)) \
sh -c '$(ninepm) -v $(TESTS); \
$(ninepm_report) github $(test-dir)/.log/last/result.json; \
sh -c '$(ninepm) -v $(TESTS); rc=$?; \
$(ninepm_report) github $(test-dir)/.log/last/result.json; \
$(ninepm_report) asciidoc $(test-dir)/.log/last/result.json; \
chmod -R 777 $(test-dir)/.log'
chmod -R 777 $(test-dir)/.log; \
exit $$rc'

test-sh:
$(test-dir)/env $(base) $(mode) $(binaries) $(pkg-$(ARCH)) -i /bin/sh
Expand Down