name: Reusable macOS Universal on: workflow_call: permissions: contents: read env: CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }} jobs: build: runs-on: macos-latest steps: - name: checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: uname -a run: uname -a - name: install required packages with Homebrew run: | HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew update HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --overwrite vulkan-loader vulkan-headers molten-vk chafa lua jq - name: configure project run: cmake -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DSET_TWEAK=Off -DBUILD_TESTS=On . - name: build project run: cmake --build . --target package --verbose -j4 - name: verify universal binary run: lipo -archs fastfetch - name: list features run: ./fastfetch --list-features - name: run fastfetch run: time ./fastfetch -c presets/ci.jsonc --structure-disabled vulkan:bluetooth:bluetoothradio --stat false - name: run fastfetch --format json run: | { time -p ./fastfetch -c presets/ci.jsonc --structure-disabled vulkan:bluetooth:bluetoothradio --format json > fastfetch.raw.json 2> fastfetch.error; } 2> fastfetch.time sed -n '/^[[:space:]]*\[/,$p' fastfetch.raw.json > fastfetch.json cat fastfetch.json cat fastfetch.error >&2 cat fastfetch.time >&2 - name: prepare benchmark data run: | real_seconds=$(awk '$1 == "real" { print $2 }' fastfetch.time) jq -e 'type == "array"' fastfetch.json > /dev/null jq --arg platform "macos" --arg arch "aarch64" --argjson real_seconds "$real_seconds" ' map(select(.stat | type == "number") | { name: ("fastfetch " + $platform + " " + $arch + " module " + .type), unit: "ms", value: .stat }) + [{ name: ("fastfetch " + $platform + " " + $arch + " total process time"), unit: "ms", value: ($real_seconds * 1000) }] ' fastfetch.json > benchmark.json cat benchmark.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@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: fastfetch-macos-universal path: ./fastfetch-*.* - name: upload benchmark data uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: benchmark-macos-universal path: benchmark.json