Skip to content

ToT libcamera build/run test #686

ToT libcamera build/run test

ToT libcamera build/run test #686

name: ToT libcamera build/run test
on:
schedule:
- cron: '02 01 * * *'
workflow_dispatch:
env:
# Customize the meson build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: release
GCC_COMPILER: "CC=/usr/bin/gcc CXX=/usr/bin/g++"
CLANG_COMPILER: "CC=/usr/bin/clang-13 CXX=/usr/bin/clang++-13"
LIBCAMERA_SRC_DIR: "${{github.workspace}}/../libcamera"
LIBCAMERA_INSTALL_DIR: "${{github.workspace}}/../libcamera/install"
LIBCAMERA_LKG_DIR: "${{github.workspace}}/../libcamera_lkg"
jobs:
build-libcamera:
runs-on: [ self-hosted ]
steps:
- name: Clean libcamera
run: rm -rf ${{env.LIBCAMERA_SRC_DIR}}
- name: Pull libcamera
run: git clone --depth=1 git://linuxtv.org/libcamera.git ${{env.LIBCAMERA_SRC_DIR}}
- name: libcamera version
run: cd ${{env.LIBCAMERA_SRC_DIR}} && git log -1
- name: Setup meson
run: cd ${{env.LIBCAMERA_SRC_DIR}} && meson build -Dprefix=${{env.LIBCAMERA_INSTALL_DIR}} -Dpipelines=rpi/vc4 -Dtest=false
- name: Build
run: cd ${{env.LIBCAMERA_SRC_DIR}}/build && ninja install
timeout-minutes: 10
- name: Tar files
run: tar -cvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}} .
- name: Upload build files
uses: actions/upload-artifact@v3
with:
name: build-artifacts-libcamera
path: build-artifacts-libcamera.tar
retention-days: 7
build-libcamera-apps:
runs-on: [ self-hosted ]
needs: build-libcamera
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
clean: true
- name: Clean libcamera
run: rm -rf ${{env.LIBCAMERA_SRC_DIR}} && mkdir -p ${{env.LIBCAMERA_SRC_DIR}}
- name: Download libcamera artifact
uses: actions/download-artifact@v3
with:
name: build-artifacts-libcamera
path: ${{github.workspace}}
- name: Untar libcamera files
run: tar -xvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}}
- name: Configure meson
run: ${{env.GCC_COMPILER}} meson setup ${{github.workspace}}/build --pkg-config-path=${{env.LIBCAMERA_INSTALL_DIR}}/lib/aarch64-linux-gnu/pkgconfig/ -Dbuildtype=${{env.BUILD_TYPE}}
timeout-minutes: 5
- name: Build
run: ninja -C ${{github.workspace}}/build
timeout-minutes: 10
- name: Tar files
run: tar -cvf build-artifacts-libcamera-apps.tar -C ${{github.workspace}}/build .
- name: Upload build files
uses: actions/upload-artifact@v3
with:
name: build-artifacts-libcamera-apps
path: build-artifacts-libcamera-apps.tar
retention-days: 7
run-test:
runs-on: ${{matrix.camera}}
needs: build-libcamera-apps
strategy:
matrix:
camera: [ imx219, imx477, imx708 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
clean: true
- name: Create test output dir
run: mkdir -p ${{github.workspace}}/test_output
- name: Download libcamera-apps build
uses: actions/download-artifact@v3
with:
name: build-artifacts-libcamera-apps
path: ${{github.workspace}}
- name: Untar libcamera-apps files
run: tar -xvf build-artifacts-libcamera-apps.tar --one-top-level=build
- name: Clean libcamera
run: rm -rf ${{env.LIBCAMERA_SRC_DIR}} && mkdir -p ${{env.LIBCAMERA_SRC_DIR}}
- name: Download libcamera artifact
uses: actions/download-artifact@v3
with:
name: build-artifacts-libcamera
path: ${{github.workspace}}
- name: Untar libcamera files
run: tar -xvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}} --one-top-level=install
- name: Print version string
run: ${{github.workspace}}/build/apps/libcamera-hello --version
- name: Print linkage info
run: ldd ${{github.workspace}}/build/apps/libcamera-hello | grep libcamera
- name: Test
run: ${{github.workspace}}/utils/camera-bug-report -o ${{github.workspace}}/test_output/bug.txt -t 300 -c "${{github.workspace}}/utils/test.py --exe-dir ${{github.workspace}}/build/apps/ --output-dir ${{github.workspace}}/test_output --json-dir ${{github.workspace}}/assets"
timeout-minutes: 8 # Must be larger than the camera-bug-report timeout.
- name: Upload test output
if: ${{failure()}}
uses: actions/upload-artifact@v3
with:
name: test-artifacts-${{matrix.camera}}
path: ${{github.workspace}}/test_output/
retention-days: 7
update-libcamera-base:
runs-on: ${{matrix.camera}}
needs: run-test
strategy:
matrix:
camera: [ imx219, imx477, imx708 ]
steps:
- name: Clean libcamera LKG
run: rm -rf ${{env.LIBCAMERA_LKG_DIR}} && mkdir -p ${{env.LIBCAMERA_LKG_DIR}}
- name: Clean libcamera
run: rm -rf ${{env.LIBCAMERA_SRC_DIR}} && mkdir -p ${{env.LIBCAMERA_SRC_DIR}}
- name: Download libcamera artifact
uses: actions/download-artifact@v3
with:
name: build-artifacts-libcamera
path: ${{github.workspace}}
- name: Untar libcamera files
run: tar -xvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}}
- name: Setup meson
run: cd ${{env.LIBCAMERA_SRC_DIR}} && meson setup build -Dprefix=${{env.LIBCAMERA_LKG_DIR}} -Dpipelines=rpi/vc4 -Dtest=false --wipe
- name: Build
run: cd ${{env.LIBCAMERA_SRC_DIR}}/build && ninja install
timeout-minutes: 10