From 334c4369faf27305d0d80464e9d2e95d027a40a9 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sun, 6 Nov 2022 21:03:31 +0700 Subject: [PATCH] fix CI scripts --- .github/workflows/darwin.yml | 14 ++++++++------ .github/workflows/linux.yml | 7 ++++--- .github/workflows/windows.yml | 11 +++++++++-- singles/CMakeLists.txt | 4 ++-- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/darwin.yml b/.github/workflows/darwin.yml index cf9f811..d88b241 100644 --- a/.github/workflows/darwin.yml +++ b/.github/workflows/darwin.yml @@ -11,19 +11,21 @@ jobs: config: # https://github.com/actions/virtual-environments/tree/main/images/macos - { os: "macos-11", xcode: "13.0", arch: "x64" } - - { os: "macos-11", xcode: "13.1", arch: "x64" } - - { os: "macos-11", xcode: "13.2", arch: "x64" } + - { os: "macos-12", xcode: "14.0", arch: "x64" } name: "xcode-${{matrix.config.xcode}}" steps: - - uses: actions/checkout@v2 + - name: Setup + run: brew install cmake ninja + - name: Checkout + uses: actions/checkout@v2 with: submodules: recursive - - name: Install ninja by Homebrew - run: brew install ninja - name: Select Xcode run: sudo xcode-select --switch "/Applications/Xcode_${{matrix.config.xcode}}.app" - - name: Build && Test + - name: Build run: | cmake --preset macos-${{matrix.config.arch}} cmake --build --preset macos-${{matrix.config.arch}}-release + - name: Test + run: | ctest --preset macos-${{matrix.config.arch}}-release \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 696d813..5a1d659 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -15,14 +15,15 @@ jobs: name: "${{matrix.config.cxx}}" steps: - name: Setup - run: sudo apt-get -y install "${{matrix.config.cc}}" "${{matrix.config.cxx}}" + run: sudo apt-get -y install cmake ninja-build ${{matrix.config.cc}} ${{matrix.config.cxx}} - name: Checkout uses: actions/checkout@v2 with: submodules: recursive - - name: Build && Test - env: { CC: "${{matrix.config.cc}}", CXX: "${{matrix.config.cxx}}" } + - name: Build run: | cmake --preset linux-${{matrix.config.cc}} cmake --build --preset linux-${{matrix.config.cc}}-release + - name: Test + run: | ctest --preset linux-${{matrix.config.cc}}-release diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f5a8569..b8f6a37 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,11 +16,18 @@ jobs: - { os: "windows-2022", vc: "msvc2022", arch: "x64" } name: "${{matrix.config.vc}} ${{matrix.config.arch}}" steps: - - uses: actions/checkout@v2 + - name: Setup + run: choco install cmake ninja + - name: Checkout + uses: actions/checkout@v2 with: submodules: recursive - - name: Build && Test + - name: Select MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Build run: | cmake --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}} cmake --build --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release + - name: Test + run: | ctest --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release diff --git a/singles/CMakeLists.txt b/singles/CMakeLists.txt index a58d8fb..c87f91c 100644 --- a/singles/CMakeLists.txt +++ b/singles/CMakeLists.txt @@ -4,7 +4,7 @@ project(meta.hpp.singles) # generate # -find_package(PythonInterp REQUIRED) +find_package(Python3 REQUIRED COMPONENTS Interpreter) set(META_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") set(META_SINGLES_INPUT "${META_ROOT_DIR}/headers/meta.hpp/meta_all.hpp") @@ -12,7 +12,7 @@ set(META_SINGLES_OUTPUT "${META_ROOT_DIR}/singles/headers/meta.hpp/meta_all.hpp" file(GLOB_RECURSE META_SINGLES_DEPENDS "${META_ROOT_DIR}/headers/*.hpp") add_custom_command(OUTPUT "${META_SINGLES_OUTPUT}" - COMMAND "${PYTHON_EXECUTABLE}" ".ci/build_singles.py" "${META_SINGLES_INPUT}" "${META_SINGLES_OUTPUT}" + COMMAND "${Python3_EXECUTABLE}" ".ci/build_singles.py" "${META_SINGLES_INPUT}" "${META_SINGLES_OUTPUT}" DEPENDS ${META_SINGLES_DEPENDS} WORKING_DIRECTORY "${META_ROOT_DIR}")