mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 09:58:03 +02:00
5b1ad1008d
Bumps the github-actions group with 3 updates: [uraimo/run-on-arch-action](https://github.com/uraimo/run-on-arch-action), [github/codeql-action/init](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action). Updates `uraimo/run-on-arch-action` from 3.1.0 to 3.2.0 - [Release notes](https://github.com/uraimo/run-on-arch-action/releases) - [Commits](https://github.com/uraimo/run-on-arch-action/compare/f9b26e3a1a408d5fd530d20c17b9f3f4428ff8d9...460cb8e6d9f726a588fc9b5e681c8a6cab09ae41) Updates `github/codeql-action/init` from 4.37.7 to 4.37.8 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd...db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28) Updates `github/codeql-action/analyze` from 4.37.7 to 4.37.8 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd...db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28) --- updated-dependencies: - dependency-name: uraimo/run-on-arch-action dependency-version: 3.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: github/codeql-action/init dependency-version: 4.37.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: github/codeql-action/analyze dependency-version: 4.37.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
136 lines
5.1 KiB
YAML
136 lines
5.1 KiB
YAML
name: Reusable Linux Hosts
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
arch:
|
|
required: true
|
|
type: string
|
|
runs-on:
|
|
required: true
|
|
type: string
|
|
outputs:
|
|
ffversion:
|
|
description: fastfetch version from linux host build
|
|
value: ${{ jobs.build.outputs.ffversion }}
|
|
|
|
permissions:
|
|
security-events: write
|
|
contents: read
|
|
|
|
env:
|
|
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ inputs.runs-on }}
|
|
outputs:
|
|
ffversion: ${{ steps.ffversion.outputs.ffversion }}
|
|
steps:
|
|
- name: checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: uname -a
|
|
run: uname -a
|
|
|
|
- name: cat /etc/os-release
|
|
run: cat /etc/os-release
|
|
|
|
- name: cat /proc/cpuinfo
|
|
run: cat /proc/cpuinfo
|
|
|
|
- name: add gcc-13 repo
|
|
run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
|
|
|
- name: install required packages
|
|
run: sudo apt-get update && sudo apt-get install -y gcc-13 jq libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libsqlite3-dev librpm-dev libegl-dev libglx-dev ocl-icd-opencl-dev libpulse-dev libdrm-dev libelf-dev libddcutil-dev libefl-all-dev libunwind-dev liblua5.4-dev libvdpau-dev libva-dev rpm ninja-build
|
|
|
|
- name: install linuxbrew packages
|
|
run: |
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
/home/linuxbrew/.linuxbrew/bin/brew install imagemagick chafa quickjs-ng --ignore-dependencies
|
|
|
|
- name: Initialize CodeQL
|
|
if: inputs.arch == 'amd64'
|
|
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
|
|
with:
|
|
languages: c
|
|
|
|
- name: configure project
|
|
run: CC=gcc-13 CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -GNinja -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=On -DENABLE_EMBEDDED_AMDGPUIDS=On -DCMAKE_INSTALL_PREFIX=/usr .
|
|
|
|
- name: build project
|
|
run: cmake --build . --target package --verbose -j4
|
|
|
|
- name: perform CodeQL analysis
|
|
if: inputs.arch == 'amd64'
|
|
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
|
|
|
|
- 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 -p ./fastfetch -c presets/ci.jsonc --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 "linux" --arg arch "${{ inputs.arch }}" --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: ldd fastfetch
|
|
|
|
- name: run tests
|
|
run: ctest --output-on-failure
|
|
|
|
- name: get fastfetch version
|
|
id: ffversion
|
|
run: echo "ffversion=$(./fastfetch --version-raw)" >> $GITHUB_OUTPUT
|
|
|
|
- name: polyfill glibc
|
|
run: |
|
|
wget https://github.com/CarterLi/polyfill-glibc/releases/download/v0.0.1/polyfill-glibc-${{ inputs.arch }} -O polyfill-glibc
|
|
chmod +x polyfill-glibc
|
|
strip fastfetch && ./polyfill-glibc fastfetch --target-glibc=2.17
|
|
strip flashfetch && ./polyfill-glibc flashfetch --target-glibc=2.17
|
|
echo 'set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-polyfilled")' >> CPackConfig.cmake
|
|
echo 'set(CPACK_PACKAGE_RELOCATABLE OFF)' >> CPackConfig.cmake
|
|
echo 'set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.17)")' >> CPackConfig.cmake
|
|
echo 'set(CPACK_RPM_SPEC_MORE_DEFINE "%global __os_install_post %{nil}")' >> CPackConfig.cmake
|
|
cpack -V
|
|
|
|
- name: upload artifacts
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: fastfetch-linux-${{ inputs.arch }}
|
|
path: ./fastfetch-*.*
|
|
|
|
- name: upload benchmark data
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: benchmark-linux-${{ inputs.arch }}
|
|
path: benchmark.json
|