From d730d36ef5c8cee117c7c16fbe32c9bb609bc184 Mon Sep 17 00:00:00 2001 From: Andy Zhang Date: Sun, 16 Jun 2024 10:47:51 +0800 Subject: [PATCH] Try fixing errors. --- .github/workflows/benchmark.yml | 11 ++++++++--- .github/workflows/codeql.yml | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index f2abb56b3..c5a8ab8f1 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -57,8 +57,6 @@ jobs: run: | brew install llvm ninja echo "PATH=$(brew --prefix llvm)/bin:$PATH" >> "$GITHUB_ENV" - echo "CMAKE_C_COMPILER=$(brew --prefix llvm)/bin/${{ matrix.c_compiler }}" >> "$GITHUB_ENV" - echo "CMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/${{ matrix.cpp_compiler }}" >> "$GITHUB_ENV" - name: Set up Python uses: actions/setup-python@v5 @@ -73,7 +71,14 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B "${{github.workspace}}/build" -DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") -DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") -DPYTHON_EXECUTABLE:FILEPATH=`which python` -DSTP_BUILD_COMPONENT_EXECUTABLE=True + run: > + cmake -B "${{github.workspace}}/build" + -DPYTHON_INCLUDE_DIR=$(python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") + -DPYTHON_LIBRARY=$(python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") + -DPYTHON_EXECUTABLE:FILEPATH=`which python` + -DSTP_BUILD_COMPONENT_EXECUTABLE=True + -DCMAKE_C_COMPILER=$(brew --prefix llvm)/bin/${{ matrix.c_compiler }}" + -DCMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/${{ matrix.cpp_compiler }}" shell: bash - name: CMake Build diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8e44f3ceb..f63f8d5da 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -65,6 +65,26 @@ jobs: - name: Install dependencies run: pip install . shell: bash + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/cmake-build" >> "$GITHUB_OUTPUT" + echo "py-build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + echo "CMAKE_C_COMPILER=clang" >> "$GITHUB_ENV" + echo "CMAKE_CXX_COMPILER=clang++" >> "$GITHUB_ENV" + + - name: Set up Homebrew + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@master + + - name: Install LLVM + run: | + brew install llvm ninja + echo "PATH=$(brew --prefix llvm)/bin:$PATH" >> "$GITHUB_ENV" + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3