Skip to content

ToT libcamera build/run test #68

ToT libcamera build/run test

ToT libcamera build/run test #68

Workflow file for this run

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"
PICAMERA2_SRC_DIR: "${{github.workspace}}/../picamera2"
LIBCAMERA_INSTALL_DIR: "${{github.workspace}}/../libcamera/install"
LIBCAMERA_LKG_DIR: "/home/pi/libcamera_lkg"
LIBCAMERA_LD_LIBRARY_DIR: "${{github.workspace}}/../libcamera/install/lib/aarch64-linux-gnu"
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 https://github.com/raspberrypi/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 setup build -Dprefix=${{env.LIBCAMERA_INSTALL_DIR}} -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dpycamera=enabled -Dtest=false -Dbuildtype=${{env.BUILD_TYPE}} -Dlibpisp:default_library=static
- name: Build
run: cd ${{env.LIBCAMERA_SRC_DIR}}/build && ninja install
timeout-minutes: 15
- name: Tar files
run: tar -cvf build-artifacts-libcamera.tar -C ${{env.LIBCAMERA_SRC_DIR}} .
- name: Upload build files
uses: actions/upload-artifact@v4
with:
name: build-artifacts-libcamera
path: build-artifacts-libcamera.tar
retention-days: 7
build-rpicam-apps:
runs-on: [ self-hosted ]
needs: build-libcamera
steps:
- uses: actions/checkout@v4
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@v4
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: 15
- name: Tar files
run: tar -cvf build-artifacts-rpicam-apps.tar -C ${{github.workspace}}/build .
- name: Upload build files
uses: actions/upload-artifact@v4
with:
name: build-artifacts-rpicam-apps
path: build-artifacts-rpicam-apps.tar
retention-days: 7
run-test:
runs-on: ${{matrix.camera}}
needs: build-rpicam-apps
strategy:
matrix:
camera: [ imx219, imx477, imx708, pi5-imx708-imx477 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
clean: true
- name: Create test output dir
run: mkdir -p ${{github.workspace}}/test_output
- name: Download rpicam-apps build
uses: actions/download-artifact@v4
with:
name: build-artifacts-rpicam-apps
path: ${{github.workspace}}
- name: Untar rpicam-apps files
run: tar -xvf build-artifacts-rpicam-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@v4
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/rpicam-hello --version
- name: Print linkage info
run: ldd ${{github.workspace}}/build/apps/rpicam-hello | grep libcamera
- name: Test rpicam-apps
run: ${{github.workspace}}/utils/test.py --exe-dir ${{github.workspace}}/build/apps/ --output-dir ${{github.workspace}}/test_output --json-dir ${{github.workspace}}/assets
timeout-minutes: 15
- name: Upload test output
if: ${{failure()}}
uses: actions/upload-artifact@v4
with:
name: test-artifacts-${{matrix.camera}}
path: ${{github.workspace}}/test_output/
retention-days: 7
run-picamera2-tests:
runs-on: ${{matrix.camera}}
needs: run-test
strategy:
matrix:
camera: [ imx219, imx477, imx708, pi5-imx708-imx477 ]
steps:
- name: Clean picamera2
run: rm -rf ${{env.PICAMERA2_SRC_DIR}}
- name: Pull picamera2
run: git clone --depth=1 https://github.com/raspberrypi/picamera2.git ${{env.PICAMERA2_SRC_DIR}}
- name: Test picamera2
run: DISPLAY=:0.0 LD_LIBRARY_PATH=${{env.LIBCAMERA_LD_LIBRARY_DIR}} PYTHONPATH=${{env.LIBCAMERA_LD_LIBRARY_DIR}}/python3.11/site-packages/:${{env.PICAMERA2_SRC_DIR}} ${{env.PICAMERA2_SRC_DIR}}/tools/run_tests.py --picamera2-dir ${{env.PICAMERA2_SRC_DIR}}
timeout-minutes: 15
update-rpicam-base:
runs-on: ${{matrix.camera}}
needs: run-picamera2-tests
strategy:
matrix:
camera: [ imx219, imx477, imx708, pi5-imx708-imx477 ]
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@v4
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,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dpycamera=enabled -Dtest=false -Dlibpisp:default_library=static --wipe
- name: Build
run: cd ${{env.LIBCAMERA_SRC_DIR}}/build && ninja install
timeout-minutes: 15