From c5e9adc643077b6d6fe5ba9b0c428034d4774e8f Mon Sep 17 00:00:00 2001 From: Nana Sakisaka <1901813+saki7@users.noreply.github.com> Date: Fri, 20 Feb 2026 02:02:31 +0900 Subject: [PATCH] Fix CI deps fixes iris-cpp/iris#33 --- .github/actions/setup/action.yml | 92 --------------- .github/workflows/build.yml | 193 ------------------------------- .github/workflows/ci.yml | 2 +- modules/iris | 2 +- test/CMakeLists.txt | 6 +- 5 files changed, 4 insertions(+), 291 deletions(-) delete mode 100644 .github/actions/setup/action.yml delete mode 100644 .github/workflows/build.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index 451bde891..000000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright 2026 The Iris Project Contributors -# -# Distributed under the Boost Software License, Version 1.0. -# https://www.boost.org/LICENSE_1_0.txt - -name: Setup Toolchain -description: Checkout, install compiler, and fetch environment info - -inputs: - os-name: - required: true - os-version: - required: true - compiler-toolset: - required: true - compiler-version: - required: true - compiler-executable: - required: true - compiler-toolset-version: - required: false - type: string - default: '' - vs-path: - required: false - type: string - default: '' - cpp-version-name: - required: true - build-type-name: - required: true - -outputs: - compiler-full-version: - description: Full version string of the compiler - value: ${{ steps.env-info.outputs.compiler-full-version }} - deps-cache-key: - description: Cache key for CMake dependencies - value: ${{ steps.env-info.outputs.deps-cache-key }} - -runs: - using: composite - steps: - - name: Initialize Ubuntu - if: inputs.os-name == 'ubuntu' - shell: bash - run: | - sudo echo "set man-db/auto-update false" | sudo debconf-communicate - sudo dpkg-reconfigure man-db - - - name: Setup GCC - if: inputs.compiler-toolset == 'gcc' - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y g++-${{ inputs.compiler-version }} - - - name: Setup Clang - if: inputs.compiler-toolset == 'clang' - shell: bash - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x ./llvm.sh - sudo ./llvm.sh ${{ inputs.compiler-version }} - sudo apt-get install -y libc++-${{ inputs.compiler-version }}-dev libc++abi-${{ inputs.compiler-version }}-dev libunwind-${{ inputs.compiler-version }}-dev - - - uses: TheMrMilchmann/setup-msvc-dev@v3 - if: inputs.os-name == 'windows' - with: - arch: x64 - vs-path: ${{ inputs.vs-path }} - toolset: ${{ inputs.compiler-toolset-version }} - - - name: Fetch Environment Info - id: env-info - shell: bash - run: | - set -e - case "${{ inputs.compiler-toolset }}" in - "gcc") - COMPILER_FULL_VERSION=$(${{ inputs.compiler-executable }} -dumpfullversion -dumpversion) - ;; - "clang") - COMPILER_FULL_VERSION=$(${{ inputs.compiler-executable }} -dumpversion) - ;; - "msvc") - COMPILER_FULL_VERSION=$(powershell -NoProfile -Command "(Get-Command ${{ inputs.compiler-executable }}).FileVersionInfo.FileVersion") - ;; - esac - echo "COMPILER_FULL_VERSION=$COMPILER_FULL_VERSION" - echo "compiler-full-version=$COMPILER_FULL_VERSION" >> "$GITHUB_OUTPUT" - echo "deps-cache-key=deps4-${{ inputs.os-name }}-${{ inputs.os-version }}-${{ inputs.compiler-toolset }}-${COMPILER_FULL_VERSION}-${{ inputs.cpp-version-name }}-${{ inputs.build-type-name }}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index aca18db21..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,193 +0,0 @@ -# Copyright 2026 The Iris Project Contributors -# -# Distributed under the Boost Software License, Version 1.0. -# https://www.boost.org/LICENSE_1_0.txt - -name: Build - -on: - workflow_call: - inputs: - os-name: - required: true - type: string - os-version: - required: true - type: string - build-type-name: - required: true - type: string - cpp-version-name: - required: true - type: string - cpp-version-number: - required: true - type: string - compiler-toolset: - required: true - type: string - compiler-version: - required: true - type: string - compiler-executable: - required: true - type: string - compiler-cxxflags: - required: false - type: string - default: "" - compiler-toolset-version: - required: false - type: string - default: "" - vs-path: - required: false - type: string - default: "" - cmake-config-additional-args: - required: false - type: string - default: "" - compiler-builder-additional-args: - required: false - type: string - default: "" - components: - required: true - type: string - description: 'JSON array of components to build (e.g. ["alloy","x4"])' - -env: - IRIS_X4_BUILD_JOBS: 4 - -jobs: - prepare-deps: - name: "Dependencies" - runs-on: ${{ inputs.os-name }}-${{ inputs.os-version }} - - steps: - - uses: actions/checkout@v5 - with: - submodules: recursive - - - name: Setup Toolchain - id: setup - uses: ./.github/actions/setup - with: - os-name: ${{ inputs.os-name }} - os-version: ${{ inputs.os-version }} - compiler-toolset: ${{ inputs.compiler-toolset }} - compiler-version: ${{ inputs.compiler-version }} - compiler-executable: ${{ inputs.compiler-executable }} - compiler-toolset-version: ${{ inputs.compiler-toolset-version }} - vs-path: ${{ inputs.vs-path }} - cpp-version-name: ${{ inputs.cpp-version-name }} - build-type-name: ${{ inputs.build-type-name }} - - - name: Cache CMake Dependencies (restore) - id: cache-deps - uses: actions/cache/restore@v4 - with: - key: ${{ steps.setup.outputs.deps-cache-key }} - path: ${{ github.workspace }}/build/_deps - - # Adapt CMP0168; enable caching in CI - # https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_FULLY_DISCONNECTED - - name: Setup Cached CMake Dependencies - id: deps-info - shell: bash - run: | - if [ "${{ steps.cache-deps.outputs.cache-hit }}" = "true" ]; then - echo "IRIS_X4_CMAKE_ARGS=-DFETCHCONTENT_FULLY_DISCONNECTED=ON" >> "$GITHUB_OUTPUT" - else - echo "IRIS_X4_CMAKE_ARGS=" >> "$GITHUB_OUTPUT" - fi - - - name: Configure - shell: bash - run: | - set -xe - cmake ${{ steps.deps-info.outputs.IRIS_X4_CMAKE_ARGS }} -B build \ - ${{ inputs.cmake-config-additional-args }} \ - -DCMAKE_CXX_COMPILER=${{ inputs.compiler-executable }} \ - -DCMAKE_CXX_FLAGS="${{ inputs.compiler-cxxflags }}" \ - -DCMAKE_CXX_STANDARD=${{ inputs.cpp-version-number }} \ - -DCMAKE_BUILD_TYPE=${{ inputs.build-type-name }} \ - -DIRIS_TEST_ALLOY=OFF \ - -DIRIS_TEST_X4=OFF \ - -DIRIS_CI=ON \ - -S . - - - name: Build Deps - run: | - cmake --build build --config ${{ inputs.build-type-name }} -j${{ env.IRIS_X4_BUILD_JOBS }} --target Catch2WithMain ${{ inputs.compiler-builder-additional-args }} - - - name: Cache CMake Dependencies (save) - # Due to some bogus "Unable to reserve cache with key" error, we *always* save the cache for now. - # See this page for the rate limit: https://docs.github.com/en/actions/reference/limits#existing-system-limits - # if: steps.cache-deps.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - key: ${{ steps.cache-deps.outputs.cache-primary-key }} - path: ${{ github.workspace }}/build/_deps - - build: - name: ${{ matrix.component }} - needs: prepare-deps - runs-on: ${{ inputs.os-name }}-${{ inputs.os-version }} - - strategy: - fail-fast: false - - matrix: - component: ${{ fromJSON(inputs.components) }} - - steps: - - uses: actions/checkout@v5 - with: - submodules: recursive - - - name: Setup Toolchain - id: setup - uses: ./.github/actions/setup - with: - os-name: ${{ inputs.os-name }} - os-version: ${{ inputs.os-version }} - compiler-toolset: ${{ inputs.compiler-toolset }} - compiler-version: ${{ inputs.compiler-version }} - compiler-executable: ${{ inputs.compiler-executable }} - cpp-version-name: ${{ inputs.cpp-version-name }} - build-type-name: ${{ inputs.build-type-name }} - - - name: Cache CMake Dependencies (restore) - id: cache-deps - uses: actions/cache/restore@v4 - with: - key: ${{ steps.setup.outputs.deps-cache-key }} - path: ${{ github.workspace }}/build/_deps - - - name: Configure - shell: bash - run: | - set -xe - cmake -DFETCHCONTENT_FULLY_DISCONNECTED=ON -B build \ - -DCMAKE_CXX_COMPILER=${{ inputs.compiler-executable }} \ - -DCMAKE_CXX_FLAGS="${{ inputs.compiler-cxxflags }}" \ - -DCMAKE_CXX_STANDARD=${{ inputs.cpp-version-number }} \ - -DCMAKE_BUILD_TYPE=${{ inputs.build-type-name }} \ - -DIRIS_TEST_ALLOY=${{ case(matrix.component == 'alloy', 'ON', 'OFF') }} \ - -DIRIS_TEST_X4=${{ case(matrix.component == 'x4', 'ON', 'OFF') }} \ - -DIRIS_CI=ON \ - -S . - - - name: Build Tests - shell: bash - run: | - echo "CPPWARNINGNOTIFIER_LOG_MARKER" - cmake --build build --config ${{ inputs.build-type-name }} -j${{ env.IRIS_X4_BUILD_JOBS }} ${{ inputs.compiler-builder-additional-args }} - - - name: Test - env: - CLICOLOR_FORCE: 1 - working-directory: ${{ github.workspace }}/build/test - run: ctest --output-on-failure -C ${{ inputs.build-type-name }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c80f1f0b..3c02dcc3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,7 +140,7 @@ jobs: compiler: name: MSVC - uses: ./.github/workflows/build.yml + uses: iris-cpp/iris/.github/workflows/build.yml@main with: os-name: ${{ matrix.os.name }} os-version: ${{ matrix.os.version }} diff --git a/modules/iris b/modules/iris index 4aa81423c..7687ea34c 160000 --- a/modules/iris +++ b/modules/iris @@ -1 +1 @@ -Subproject commit 4aa81423cc92eaefb86112cc066a0b059e8824db +Subproject commit 7687ea34caed5e33654f7079ed6b49dfca6766b0 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8e984fbc4..1e5a28cc2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -5,12 +5,10 @@ # https://www.boost.org/LICENSE_1_0.txt if(PROJECT_IS_TOP_LEVEL) - option(IRIS_TEST_ALLOY "test alloy" ON) - if(IRIS_TEST_ALLOY) + if(NOT DEFINED IRIS_CI_COMPONENT OR IRIS_CI_COMPONENT STREQUAL alloy) add_subdirectory(alloy) endif() - option(IRIS_TEST_X4 "test x4" ON) - if(IRIS_TEST_X4) + if(NOT DEFINED IRIS_CI_COMPONENT OR IRIS_CI_COMPONENT STREQUAL x4) add_subdirectory(x4) endif() endif()