From 2475ebc2ac65f774207af52df979ff6bfe1aa453 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Wed, 9 Feb 2022 19:49:45 +0100 Subject: [PATCH] fix publishing wheels on macOS; fix build for codeql. --- .github/codeql/codeql_config.yaml | 5 +++++ .github/workflows/build_macos_wheels.yml | 5 +++++ .github/workflows/codeql_analysis.yml | 4 ++-- python-webrtc/cpp/CMakeLists.txt | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .github/codeql/codeql_config.yaml diff --git a/.github/codeql/codeql_config.yaml b/.github/codeql/codeql_config.yaml new file mode 100644 index 0000000..96b2a6f --- /dev/null +++ b/.github/codeql/codeql_config.yaml @@ -0,0 +1,5 @@ +name: "CodeQL config" +paths-ignore: + - third_party + - tests + - lib diff --git a/.github/workflows/build_macos_wheels.yml b/.github/workflows/build_macos_wheels.yml index 14750e2..6efb0a6 100644 --- a/.github/workflows/build_macos_wheels.yml +++ b/.github/workflows/build_macos_wheels.yml @@ -61,6 +61,11 @@ jobs: name: wrtc for macOS (${{ matrix.arch }}) path: ./wheelhouse/*.whl + - uses: actions/setup-python@v2 + if: github.ref == 'refs/heads/pypi-dev' && github.repository == 'MarshalX/python-webrtc' + with: + python-version: 3.7 + - name: Publish a Python distribution to PyPI. if: github.ref == 'refs/heads/pypi-dev' && github.repository == 'MarshalX/python-webrtc' env: diff --git a/.github/workflows/codeql_analysis.yml b/.github/workflows/codeql_analysis.yml index 239b847..e05af9a 100644 --- a/.github/workflows/codeql_analysis.yml +++ b/.github/workflows/codeql_analysis.yml @@ -14,8 +14,6 @@ jobs: name: Analyze runs-on: ubuntu-latest permissions: - actions: read - contents: read security-events: write strategy: @@ -38,11 +36,13 @@ jobs: uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} + config-file: ./.github/codeql/codeql_config.yaml - if: matrix.language == 'cpp' name: Build run: | sudo apt install -y python3.9-dev + export NO_LTO=true python setup.py build - name: Perform CodeQL Analysis diff --git a/python-webrtc/cpp/CMakeLists.txt b/python-webrtc/cpp/CMakeLists.txt index d9c17a3..9ee1d99 100644 --- a/python-webrtc/cpp/CMakeLists.txt +++ b/python-webrtc/cpp/CMakeLists.txt @@ -2,6 +2,10 @@ configure_file("${src_loc}/config.h.in" "${src_loc}/config.h") file(GLOB_RECURSE MODULE_SRC ${src_loc}/*.cpp ${src_loc}/*.h) +if ("$ENV{NO_LTO}" STREQUAL "true") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF) +endif() + pybind11_add_module(${MODULE} ${MODULE_SRC}) set_property(TARGET ${MODULE} PROPERTY CXX_STANDARD 17)