diff --git a/.github/workflows/mediasoup-rust-debug.yaml b/.github/workflows/mediasoup-rust-debug.yaml index 4bd2310d75..ec1e921b74 100644 --- a/.github/workflows/mediasoup-rust-debug.yaml +++ b/.github/workflows/mediasoup-rust-debug.yaml @@ -24,6 +24,7 @@ jobs: arch: arm64 - os: macos-12 - os: macos-14 + - os: windows-2022 runs-on: ${{ matrix.ci.os }} diff --git a/.github/workflows/mediasoup-worker-debug.yaml b/.github/workflows/mediasoup-worker-debug.yaml deleted file mode 100644 index 582f995971..0000000000 --- a/.github/workflows/mediasoup-worker-debug.yaml +++ /dev/null @@ -1,111 +0,0 @@ -name: mediasoup-worker-debug - -on: [pull_request, workflow_dispatch] - -concurrency: - # Cancel a currently running workflow from the same PR, branch or tag when a - # new workflow is triggered. - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - ci: - strategy: - matrix: - build: - - os: ubuntu-20.04 - cc: gcc - cxx: g++ - - os: ubuntu-20.04 - cc: clang - cxx: clang++ - - os: ubuntu-22.04 - cc: gcc - cxx: g++ - - os: ubuntu-22.04 - cc: clang - cxx: clang++ - - os: ubuntu-20.04 - cc: gcc - cxx: g++ - arch: arm64 - - os: ubuntu-20.04 - cc: clang - cxx: clang++ - arch: arm64 - - os: ubuntu-22.04 - cc: gcc - cxx: g++ - arch: arm64 - - os: ubuntu-22.04 - cc: clang - cxx: clang++ - arch: arm64 - - os: macos-12 - cc: gcc - cxx: g++ - - os: macos-14 - cc: clang - cxx: clang++ - - os: windows-2022 - cc: cl - cxx: cl - # A single Node.js version should be fine for C++. - node: - - 20 - - runs-on: ${{ matrix.build.os }} - - env: - CC: ${{ matrix.build.cc }} - CXX: ${{ matrix.build.cxx }} - MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true' - MEDIASOUP_LOCAL_DEV: 'true' - MEDIASOUP_BUILDTYPE: 'Debug' - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - - name: Configure cache - uses: actions/cache@v3 - with: - path: | - ~/.npm - key: ${{ matrix.build.os }}-node-${{matrix.build.cc}}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ matrix.build.os }}-node-${{matrix.build.cc}}- - - # We need to install pip invoke manually. - - name: pip3 install invoke - run: pip3 install invoke - if: runner.os != 'macOS' - - # In macOS we need to specify this option. - - name: pip3 install --break-system-packages invoke - run: pip3 install --break-system-packages invoke - if: runner.os == 'macOS' - - # We need to install npm deps of worker/scripts/package.json. - - name: npm ci --prefix worker/scripts - run: npm ci --prefix worker/scripts --foreground-scripts - # TODO: Maybe fix this one day. - if: runner.os != 'Windows' - - - name: invoke -r worker lint - run: invoke -r worker lint - # TODO: Maybe fix this one day. - if: runner.os != 'Windows' - - - name: invoke -r worker mediasoup-worker - run: invoke -r worker mediasoup-worker - - - name: invoke -r worker test - run: invoke -r worker test - # TODO: Maybe fix this one day. - if: runner.os != 'Windows' diff --git a/.github/workflows/mediasoup-worker.yaml b/.github/workflows/mediasoup-worker.yaml index e82031189d..0b05cd9dc1 100644 --- a/.github/workflows/mediasoup-worker.yaml +++ b/.github/workflows/mediasoup-worker.yaml @@ -53,6 +53,9 @@ jobs: # A single Node.js version should be fine for C++. node: - 20 + build-type: + - Release + - Debug runs-on: ${{ matrix.build.os }} @@ -61,7 +64,7 @@ jobs: CXX: ${{ matrix.build.cxx }} MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true' MEDIASOUP_LOCAL_DEV: 'true' - MEDIASOUP_BUILDTYPE: 'Release' + MEDIASOUP_BUILDTYPE: ${{ matrix.build-type }} steps: - name: Checkout diff --git a/worker/build.rs b/worker/build.rs index 0d9e0adbd1..920d185d7b 100644 --- a/worker/build.rs +++ b/worker/build.rs @@ -2,15 +2,12 @@ use std::process::Command; use std::{env, fs}; fn main() { - // Honor MEDIASOUP_BUILDTYPE environment variable if given. - // On Windows Rust always links against release version of MSVC runtime, - // thus requires Release build - let build_type = if env::var("MEDIASOUP_BUILDTYPE").is_ok() && cfg!(not(windows)) { - env::var("MEDIASOUP_BUILDTYPE").unwrap().to_string() - } else if cfg!(all(debug_assertions, not(windows))) { - "Debug".to_string() + // On Windows Rust always links against release version of MSVC runtime, thus requires + // Release build here + let build_type = if cfg!(all(debug_assertions, not(windows))) { + "Debug" } else { - "Release".to_string() + "Release" }; let out_dir = env::var("OUT_DIR").unwrap();