ToT libcamera build/run test #860
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "${{github.workspace}}/../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@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: 15 | |
- 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, pi5-imx708-imx477 ] | |
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 libcamera-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@v3 | |
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-libcamera-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@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,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 |