Skip to content

RSDK-14226: Use docker images in CI jobs #2364

RSDK-14226: Use docker images in CI jobs

RSDK-14226: Use docker images in CI jobs #2364

Workflow file for this run

name: Test
on:
pull_request:
paths-ignore:
- '**.md'
- 'res/**'
workflow_dispatch:
inputs:
no-tidy:
type: boolean
description: set to true to build without clang-tidy (2x faster)
jobs:
test_ubuntu:
if: github.repository_owner == 'viamrobotics'
runs-on: ubuntu-latest
container:
image: ghcr.io/viamrobotics/cpp-sdk-system-debian:bookworm
strategy:
fail-fast: false
matrix:
include:
- BUILD_SHARED: ON
- BUILD_SHARED: OFF
steps:
- uses: actions/checkout@v4
- name: Install test-only dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
curl \
gettext \
lsof
- name: Build viam server
run: |
curl https://storage.googleapis.com/packages.viam.com/apps/viam-server/viam-server-latest-x86_64 -o viam-server
chmod 755 viam-server
mv viam-server /usr/local/bin
- name: cmake
run: |
mkdir build
cd build
cmake .. -G Ninja \
-DBUILD_SHARED_LIBS=${{ matrix.BUILD_SHARED }} \
-DVIAMCPPSDK_OFFLINE_PROTO_GENERATION=ON \
-DVIAMCPPSDK_BUILD_TESTS=ON \
-DVIAMCPPSDK_BUILD_EXAMPLES=ON \
-DVIAMCPPSDK_CLANG_TIDY=${{ inputs.no-tidy && 'OFF' || 'ON' }} \
-DVIAMCPPSDK_SANITIZED_BUILD=${{ matrix.BUILD_SHARED }}
- name: build
run: |
cmake --build build --target install
cmake --install build
- name: Module test
run: etc/module_test/entrypoint.sh
- name: Check standalone examples compile
run: |
cmake -B build-standalone-cmake -S src/viam/examples/project/cmake \
-G Ninja \
-DCMAKE_PREFIX_PATH=$(pwd)/build/install
cmake --build build-standalone-cmake
- name: test
working-directory: build
run: ../etc/docker/tests/run_test.sh
test_windows:
if: github.repository_owner == 'viamrobotics'
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-windows
platform: windows_x86_64
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.sha }}
- name: Install dependencies
run: choco install -y conan git
- name: Build SDK
shell: powershell
run: |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv
conan profile detect
conan remote add viamconan $env:CONAN_REMOTE_URL
conan remote auth --force -cc core:non_interactive=True viamconan
conan install . --build=missing -o "&:opentelemetry_tracing=False" -s:a compiler.cppstd=17 --lockfile etc/conan/conan.lock --lockfile-partial
cmake . --preset conan-default -DVIAMCPPSDK_BUILD_EXAMPLES=ON
cmake --build --preset=conan-release --target ALL_BUILD install -j 8
env:
CONAN_USER_HOME: c:/cache
CONAN_USER_HOME_SHORT: c:/cache/conan_shortpaths
CONAN_REMOTE_URL: ${{ secrets.conanRemote }}
CONAN_LOGIN_USERNAME_VIAMCONAN: ${{ secrets.conanUsername }}
CONAN_PASSWORD_VIAMCONAN: ${{ secrets.conanPassword }}
- name: Test examples
shell: powershell
run: |
Start-Job -Init ([ScriptBlock]::Create("Set-Location '$pwd/build/install/bin'")) -ScriptBlock { .\simple_module.exe asdf 2>&1 > output.txt} | Wait-Job -Timeout 2 | Receive-Job
if (-not $(Select-String -Pattern "Module listening" -Path ./build/install/bin/output.txt)) { throw "Module did not start listening" }