Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use macos-latest #690

Closed
wants to merge 17 commits into from
18 changes: 8 additions & 10 deletions .github/workflows/analyzers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
types:
- completed

env:
CACHE_INDEX: '2'

jobs:
pvs:
Expand All @@ -25,10 +27,9 @@ jobs:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}

- name: Install Qt
uses: jurplel/install-qt-action@v4
- uses: actions/setup-python@v5
with:
cache: true
python-version: '3.6.x - 3.11.x'

- name: get conan
uses: turtlebrowser/get-conan@main
Expand All @@ -39,8 +40,7 @@ jobs:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}
restore-keys: deps-ci-ubuntu-clang-Release
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}-${{env.CACHE_INDEX}}

- name: conan detect profile
run: |
Expand Down Expand Up @@ -98,10 +98,9 @@ jobs:
- name: Install llvm
run: sudo apt-get update -q && sudo apt-get install llvm -q -y

- name: Install Qt
uses: jurplel/install-qt-action@v4
- uses: actions/setup-python@v5
with:
cache: true
python-version: '3.6.x - 3.11.x'

- name: get conan
uses: turtlebrowser/get-conan@main
Expand All @@ -112,8 +111,7 @@ jobs:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}
restore-keys: deps-ci-ubuntu-clang-Release
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}-${{env.CACHE_INDEX}}

- name: conan detect profile
run: |
Expand Down
48 changes: 13 additions & 35 deletions .github/workflows/ci v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
CACHE_INDEX: '2'

jobs:
cache_deps:
Expand All @@ -24,8 +26,8 @@ jobs:
config: [{name: ci-ubuntu-gcc, os: ubuntu-latest},
{name: ci-ubuntu-clang, os: ubuntu-latest},
{name: ci-windows, os: windows-latest},
{name: ci-macos, os: macos-12}]
build_type: [{config: Release}, {config: Debug}]
{name: ci-macos, os: macos-latest}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Based on the output, I can generate the final response as we have sufficient information about the available macOS runners. The script results show that GitHub Actions currently supports macOS versions 12 through 15, including ARM64 variants for versions 13-15.

Specify macOS version 14 instead of using latest

Using macos-latest may lead to unexpected behavior when GitHub automatically updates the runner. Based on the available runners, it's recommended to use macos-14 as it represents a stable, recent version while maintaining predictability in your CI pipeline.

  • Update line 29: Replace macos-latest with macos-14
  • Update line 142: Replace macos-latest with macos-14
🔗 Analysis chain

Consider using a specific macOS version instead of latest

While macos-latest automatically provides the most recent stable runner, it may introduce unexpected behavior when GitHub updates the runner version. Consider using a specific version (e.g., macos-13) for better stability and predictability.

Run this script to check the current macOS version and available options:

Also applies to: 142-142

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check current macOS runner version and available options

# Get current macos-latest version
gh api \
  -H "Accept: application/vnd.github+json" \
  /repos/actions/runner-images/contents/images/macos/macos-latest.json | jq -r '.content' | base64 -d | jq '.os_version'

# List available macOS runner versions
gh api \
  -H "Accept: application/vnd.github+json" \
  /repos/actions/runner-images/contents/images/macos | jq -r '.[].name' | grep macos

Length of output: 570

build_type: [{config: Release}]

timeout-minutes: 120
runs-on: ${{ matrix.config.os }}
Expand All @@ -50,16 +52,9 @@ jobs:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}
restore-keys: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}
key: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}-${{env.CACHE_INDEX}}
lookup-only: true

- name: Install Qt
if: steps.check_cache.outputs.cache-hit != 'true' || github.event_name == 'schedule'
uses: jurplel/install-qt-action@v4
with:
cache: true

- name: conan detect profile
if: steps.check_cache.outputs.cache-hit != 'true' || github.event_name == 'schedule'
run: |
Expand Down Expand Up @@ -88,18 +83,9 @@ jobs:
with:
fetch-depth: 0

# Work around https://github.com/actions/runner-images/issues/8659
# - name: "Remove GCC 13 from runner image (workaround)"
# shell: bash
# run: |
# sudo apt-get update
# sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev
# sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.*

- name: Install Qt
uses: jurplel/install-qt-action@v4
- uses: actions/setup-python@v5
with:
cache: true
python-version: '3.6.x - 3.11.x'

- name: get conan
uses: turtlebrowser/get-conan@main
Expand All @@ -110,8 +96,7 @@ jobs:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}
restore-keys: deps-ci-ubuntu-clang-Release
key: deps-ci-ubuntu-clang-Release-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}-${{env.CACHE_INDEX}}

- name: conan detect profile
run: |
Expand All @@ -137,9 +122,9 @@ jobs:
config: [{name: ci-ubuntu-gcc, os: ubuntu-latest},
{name: ci-ubuntu-clang, os: ubuntu-latest},
{name: ci-windows, os: windows-latest},
{name: ci-macos, os: macos-12}]
{name: ci-macos, os: macos-latest}]
type: [tests, benchmarks]
build_type: [{config: Release, test_preset: ci-tests}, {config: Debug, test_preset: ci-tests-debug}]
build_type: [{config: Release, test_preset: ci-tests}]
optimization_disabled: [{mode: 0, postfix: ""}, {mode: 1, postfix: " (Optimizations disabled)"}]

timeout-minutes: 20
Expand Down Expand Up @@ -174,10 +159,9 @@ jobs:
- name: Cmake version
run: cmake --version

- name: Install Qt
uses: jurplel/install-qt-action@v4
- uses: actions/setup-python@v5
with:
cache: true
python-version: '3.6.x - 3.11.x'

- name: get conan
uses: turtlebrowser/get-conan@main
Expand All @@ -188,8 +172,7 @@ jobs:
path: |
~/.conan2
/Users/runner/.conan2/
key: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}
restore-keys: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}
key: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }}-${{ hashFiles('**/conanfile.py') }}-${{ hashFiles('**/CMakePresets.json') }}-${{env.CACHE_INDEX}}

- name: conan detect profile
run: |
Expand Down Expand Up @@ -254,11 +237,6 @@ jobs:
with:
fetch-depth: 0

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
cache: true

- name: Install project and build
env:
CC: gcc-10
Expand Down
14 changes: 7 additions & 7 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,24 @@ endif()

# ==================== QT ==========================
if (RPP_BUILD_QT_CODE AND (RPP_BUILD_TESTS OR RPP_BUILD_EXAMPLES))
find_package(Qt6 COMPONENTS Widgets QUIET)
find_package(Qt6 COMPONENTS Widgets Core Gui QUIET)
if (Qt6_FOUND)
SET(RPP_QT_TARGET Qt6)
else()
message("-- RPP: Can't find Qt6, searching for Qt5...")
find_package(Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt5 REQUIRED COMPONENTS Widgets Core Gui)
SET(RPP_QT_TARGET Qt5)
endif()

message("-- RPP: Found QT version: ${RPP_QT_TARGET}")
macro(rpp_add_qt_support_to_executable TARGET)
target_link_libraries(${TARGET} PRIVATE ${RPP_QT_TARGET}::Widgets)
set_target_properties(${TARGET} PROPERTIES AUTOMOC TRUE)
if (WIN32)
add_custom_command (TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${RPP_QT_TARGET}::Core> $<TARGET_FILE_DIR:${TARGET}>)
add_custom_command (TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${RPP_QT_TARGET}::Widgets> $<TARGET_FILE_DIR:${TARGET}>)
add_custom_command (TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${RPP_QT_TARGET}::Gui> $<TARGET_FILE_DIR:${TARGET}>)
endif()
# if (WIN32)
# add_custom_command (TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${RPP_QT_TARGET}::Core> $<TARGET_FILE_DIR:${TARGET}>)
# add_custom_command (TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${RPP_QT_TARGET}::Widgets> $<TARGET_FILE_DIR:${TARGET}>)
# add_custom_command (TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${RPP_QT_TARGET}::Gui> $<TARGET_FILE_DIR:${TARGET}>)
# endif()
endmacro()
endif()

Expand Down
3 changes: 3 additions & 0 deletions cmake/variables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ if (RPP_DEVELOPER_MODE)
if (RPP_BUILD_ASIO_CODE)
set(CONAN_ARGS "${CONAN_ARGS};-o rpp/*:with_asio=True")
endif()
if (RPP_BUILD_QT_CODE)
set(CONAN_ARGS "${CONAN_ARGS};-o rpp/*:with_qt=True")
endif()
endif()

if(RPP_ENABLE_COVERAGE)
Expand Down
10 changes: 8 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ class RppConan(ConanFile):
"with_tests" : [False, True],
"with_cmake" : [False, True],
"with_benchmarks" : [False, True],
"with_asio" : [False, True]
"with_asio" : [False, True],
"with_qt" : [False, True],
}
default_options = {
"with_grpc" : False,
"with_sfml" : False,
"with_tests": False,
"with_cmake": False,
"with_benchmarks" : False,
"with_asio" : False
"with_asio" : False,
"with_qt" : False,
"qt/*:shared": True,
}

def requirements(self):
Expand All @@ -44,3 +47,6 @@ def requirements(self):

if self.options.with_cmake:
self.tool_requires("cmake/3.29.3")

if self.options.with_qt:
self.requires("qt/5.15.14", transitive_libs=True)
Loading