diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 0000000..b7c120e --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,36 @@ +name: Build and test +on: + push: + branches: [ "wip_actions" ] + pull_request: + branches: [ "wip_actions" ] + +jobs: + build: + runs-on: ubuntu-24.04 + container: archlinux:base-devel + steps: + - name: install-dependencies + run: | + sudo pacman -Syu --noconfirm cmake git git-lfs boost boost-libs doxygen nodejs node-gyp gtest yarn ffmpeg nlohmann-json + sudo corepack enable + - uses: actions/checkout@v4 + with: + path: ./src + submodules: recursive + - name: build-debug + run: | + cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_JS=On -DXCMAKE_CLANG_TIDY=OFF -DXCMAKE_SYSTEM_GTEST=ON -DXCMAKE_DOXYGEN_WERROR=OFF -DCMAKE_INSTALL_PREFIX=inst -Bbuild src + make -C build install -j$(nproc) + - name: build-release + run: | + rm -rf build inst + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_JS=On -DXCMAKE_PACKAGING=On -DXCMAKE_CLANG_TIDY=OFF -DXCMAKE_SYSTEM_GTEST=ON -DXCMAKE_DOXYGEN_WERROR=Off -DCMAKE_INSTALL_PREFIX=inst -Bbuild src + make -C build install package -j$(nproc) + tar tf build/*.tar.gz + # Check package contents. + tar tf build/*.tar.gz | grep -qE '^spectral-live-video-streamer/bin/live-video-streamer-server$' + tar tf build/*.tar.gz | grep -qE '^SpectralLiveVideoStreamer/share/spectral-video-streamer/demo-client/index[.]html$' + tar tf build/*.tar.gz | grep -qE '^SpectralLiveVideoStreamer/share/spectral-video-streamer/client/live-video-streamer-client[.]js$' + tar tf build/*.tar.gz | grep -qE '^SpectralLiveVideoStreamer/share/spectral-video-streamer/client/live-video-streamer-client[.]d[.]ts$' + ! tar tf build/*.tar.gz | grep -qE '([.]map|/asset-manifest[.]json)$'