|
| 1 | +name: Libcamera Build and Test |
| 2 | +# START OF COMMON SECTION |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'master', 'main', 'release/**' ] |
| 6 | + pull_request: |
| 7 | + branches: [ '*' ] |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | +# END OF COMMON SECTION |
| 12 | +jobs: |
| 13 | + libcamera_build_test: |
| 14 | + name: Libcamera Build Test |
| 15 | + timeout-minutes: 20 |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: [ ubuntu-latest ] |
| 19 | + libcamera_ref: [ 'master', 'v0.5.1', 'v0.0.3' ] |
| 20 | + fail-fast: false |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + steps: |
| 23 | + - name: Checkout gnutls-wolfssl repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + - name: Setup Python 3.11 for older libcamera |
| 26 | + if: matrix.libcamera_ref == 'v0.0.3' |
| 27 | + uses: actions/setup-python@v4 |
| 28 | + with: |
| 29 | + python-version: '3.11' |
| 30 | + - name: Ensure make available (Ubuntu only) |
| 31 | + if: matrix.os == 'ubuntu-latest' |
| 32 | + run: | |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install -y build-essential |
| 35 | + - name: Install GnuTLS dependencies (Ubuntu only) |
| 36 | + if: matrix.os == 'ubuntu-latest' |
| 37 | + run: | |
| 38 | + sudo apt-get install -y gnulib autopoint gperf gtk-doc-tools nettle-dev clang libtasn1-bin libtasn1-6-dev libunistring-dev libp11-kit-dev libunbound-dev libjpeg-dev |
| 39 | + - name: Install libcamera dependencies (Ubuntu only) |
| 40 | + if: matrix.os == 'ubuntu-latest' |
| 41 | + run: | |
| 42 | + sudo apt-get install -y cmake meson ninja-build pkg-config python3-ply python3-jinja2 python3-yaml libyaml-dev libgtest-dev |
| 43 | + - name: Install Python dependencies for v0.0.3 |
| 44 | + if: matrix.libcamera_ref == 'v0.0.3' |
| 45 | + run: | |
| 46 | + python -m pip install ply jinja2 pyyaml |
| 47 | + - name: Build GnuTLS with wolfSSL provider using setup.sh script |
| 48 | + run: | |
| 49 | + GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh |
| 50 | + - name: Check setup.sh output directories |
| 51 | + run: | |
| 52 | + test -d /opt/wolfssl || exit 1 |
| 53 | + test -d /opt/gnutls || exit 1 |
| 54 | + test -d /opt/wolfssl-gnutls-wrapper/lib || exit 1 |
| 55 | + - name: Checkout libcamera at ${{ matrix.libcamera_ref }} |
| 56 | + run: | |
| 57 | + git clone https://git.libcamera.org/libcamera/libcamera.git |
| 58 | + cd libcamera |
| 59 | + if [ "${{ matrix.libcamera_ref }}" != "master" ]; then |
| 60 | + git checkout ${{ matrix.libcamera_ref }} |
| 61 | + fi |
| 62 | + - name: Configure and build libcamera |
| 63 | + working-directory: libcamera |
| 64 | + run: | |
| 65 | + export PKG_CONFIG_PATH=/opt/gnutls/lib/pkgconfig:$PKG_CONFIG_PATH |
| 66 | + export CPPFLAGS="-I/opt/gnutls/include $CPPFLAGS" |
| 67 | + export LDFLAGS="-L/opt/gnutls/lib -Wl,-rpath,/opt/gnutls/lib $LDFLAGS" |
| 68 | + export LD_LIBRARY_PATH="/opt/gnutls/lib:$LD_LIBRARY_PATH" |
| 69 | + meson setup build -Dtest=true |
| 70 | + meson compile -C build |
| 71 | + - name: Run unit-tests that don’t need hardware |
| 72 | + working-directory: libcamera/build |
| 73 | + run: | |
| 74 | + if [ "${{ matrix.libcamera_ref }}" = "v0.0.3" ]; then |
| 75 | + meson test -v \ |
| 76 | + 'control_info' 'control_value' \ |
| 77 | + 'ipa_module_test' 'ipa_interface_test' \ |
| 78 | + 'unixsocket_ipc' 'unixsocket' 'log_api' 'log_process' \ |
| 79 | + 'process_test' 'generated_serializer_test' \ |
| 80 | + 'stream_formats' 'stream_colorspace' 'color-space' 'geometry' \ |
| 81 | + 'public-api' 'signal' 'span' 'bayer-format' 'byte-stream-buffer' \ |
| 82 | + 'event-thread' 'file' 'flags' 'event' 'object' 'object-delete' \ |
| 83 | + 'object-invoke' 'pixel-format' 'shared-fd' 'message' \ |
| 84 | + 'signal-threads' 'threads' 'timer-thread' 'unique-fd' 'utils' \ |
| 85 | + 'yaml-parser' 'event-dispatcher' 'timer' |
| 86 | + else |
| 87 | + meson test -v \ |
| 88 | + 'control_info' 'control_value' 'fixedpoint' 'histogram' \ |
| 89 | + 'interpolator' 'ipa_module_test' 'ipa_interface_test' \ |
| 90 | + 'unixsocket_ipc' 'unixsocket' 'log_api' 'log_process' \ |
| 91 | + 'process_test' 'generated_serializer_test' 'stream_formats' \ |
| 92 | + 'stream_colorspace' 'color-space' 'geometry' 'public-api' \ |
| 93 | + 'signal' 'span' 'transform' 'bayer-format' 'byte-stream-buffer' \ |
| 94 | + 'event-thread' 'file' 'flags' 'matrix' 'event' 'object' \ |
| 95 | + 'object-delete' 'object-invoke' 'pixel-format' 'shared-fd' \ |
| 96 | + 'message' 'signal-threads' 'threads' 'timer-thread' 'unique-fd' \ |
| 97 | + 'utils' 'vector' 'yaml-parser' 'event-dispatcher' 'timer' |
| 98 | + fi |
0 commit comments