From a1873f3e9ec59613a4d43a6d37b6a86d789e31db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 17 Jun 2025 09:01:38 +0800 Subject: [PATCH] CI: split amd64 and arm64 builds So we can test both platforms in CI --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++---- CMakeLists.txt | 20 +++++++------- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 541437547..fb3f9f6ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -408,9 +408,9 @@ jobs: name: fastfetch-musl-amd64 path: ./fastfetch-*.* - macos-universal: - name: macOS-universal - runs-on: macos-latest + macos-amd64: + name: macOS-amd64 + runs-on: macos-13 permissions: security-events: write contents: read @@ -426,7 +426,7 @@ jobs: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk imagemagick chafa - name: configure project - run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' . + run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . - name: build project run: cmake --build . --target package --verbose -j4 @@ -452,7 +452,54 @@ jobs: - name: upload artifacts uses: actions/upload-artifact@v4 with: - name: fastfetch-macos-universal + name: fastfetch-macos-amd64 + path: ./fastfetch-*.* + + macos-aarch64: + name: macOS-aarch64 + runs-on: macos-latest + permissions: + security-events: write + contents: read + steps: + - name: checkout repository + uses: actions/checkout@v4 + + - name: uname -a + run: uname -a + + - name: install required packages + run: | + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk imagemagick chafa + + - name: configure project + run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . + + - name: build project + run: cmake --build . --target package --verbose -j4 + + - name: list features + run: ./fastfetch --list-features + + - name: run fastfetch + run: time ./fastfetch -c presets/ci.jsonc --stat false + + - name: run fastfetch --format json + run: time ./fastfetch -c presets/ci.jsonc --format json + + - name: run flashfetch + run: time ./flashfetch + + - name: print dependencies + run: otool -L fastfetch + + - name: run tests + run: ctest --output-on-failure + + - name: upload artifacts + uses: actions/upload-artifact@v4 + with: + name: fastfetch-macos-aarch64 path: ./fastfetch-*.* sunos-amd64: @@ -808,7 +855,8 @@ jobs: - linux-ppc64le - linux-s390x - musl-amd64 - - macos-universal + - macos-amd64 + - macos-aarch64 - freebsd-amd64 - openbsd-amd64 - netbsd-amd64 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9be417803..8725e501a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1924,17 +1924,17 @@ install( ################## set(CPACK_GENERATOR "TGZ;ZIP") +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(CMAKE_SYSTEM_PROCESSOR "amd64") +elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") + set(CMAKE_SYSTEM_PROCESSOR "aarch64") +endif() if(APPLE) - string(TOLOWER "${CMAKE_PROJECT_NAME}-macos-universal" CPACK_PACKAGE_FILE_NAME) -else() # We don't use this in Windows - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - set(CMAKE_SYSTEM_PROCESSOR "amd64") - endif() - if(IS_MUSL) - string(TOLOWER "${CMAKE_PROJECT_NAME}-musl-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME) - else() - string(TOLOWER "${CMAKE_PROJECT_NAME}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME) - endif() + string(TOLOWER "${CMAKE_PROJECT_NAME}-macos-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME) # use macos instead of darwin +elseif(IS_MUSL) + string(TOLOWER "${CMAKE_PROJECT_NAME}-musl-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME) +else() + string(TOLOWER "${CMAKE_PROJECT_NAME}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" CPACK_PACKAGE_FILE_NAME) endif() if(LINUX)