Merge pull request #617 from fastfetch-cli/dev #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
- pull_request | |
jobs: | |
linux-buildtest: | |
name: Linux build test | |
permissions: | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, ubuntu-20.04] | |
compiler: [ | |
{ cc: gcc, cxx: "g++" }, | |
{ cc: clang, cxx: "clang++" }, | |
{ cc: "musl-gcc", cxx: "musl-g++" } | |
] | |
enableFeatures: [ON, OFF] | |
exclude: | |
# The feature libraries are all build against glibc, so they can't be used with musl | |
- compiler: { cc: "musl-gcc", cxx: "musl-g++" } | |
enableFeatures: ON | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: uname -a | |
run: uname -a | |
- name: install required packages | |
run: sudo apt-get update && sudo apt-get install -y musl-dev musl-tools linux-headers-generic libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev rpm librpm-dev libzstd-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev directx-headers-dev | |
- name: configure project | |
env: | |
CC: ${{ matrix.compiler.cc }} | |
CXX: ${{ matrix.compiler.cxx }} | |
run: cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_LIBPCI=${{ matrix.enableFeatures }} -DENABLE_VULKAN=${{ matrix.enableFeatures }} -DENABLE_WAYLAND=${{ matrix.enableFeatures }} -DENABLE_XCB_RANDR=${{ matrix.enableFeatures }} -DENABLE_XCB=${{ matrix.enableFeatures }} -DENABLE_XRANDR=${{ matrix.enableFeatures }} -DENABLE_X11=${{ matrix.enableFeatures }} -DENABLE_GIO=${{ matrix.enableFeatures }} -DENABLE_DCONF=${{ matrix.enableFeatures }} -DENABLE_DBUS=${{ matrix.enableFeatures }} -DENABLE_XFCONF=${{ matrix.enableFeatures }} -DENABLE_SQLITE3=${{ matrix.enableFeatures }} -DENABLE_RPM=${{ matrix.enableFeatures }} -DENABLE_IMAGEMAGICK7=${{ matrix.enableFeatures }} -DENABLE_IMAGEMAGICK6=${{ matrix.enableFeatures }} -DENABLE_CHAFA=${{ matrix.enableFeatures }} -DENABLE_ZLIB=${{ matrix.enableFeatures }} -DENABLE_EGL=${{ matrix.enableFeatures }} -DENABLE_GLX=${{ matrix.enableFeatures }} -DENABLE_OSMESA=${{ matrix.enableFeatures }} -DENABLE_OPENCL=${{ matrix.enableFeatures }} -DENABLE_LIBNM=${{ matrix.enableFeatures }} -DENABLE_PULSE=${{ matrix.enableFeatures }} -DENABLE_DIRECTX_HEADERS=${{ matrix.enableFeatures }} . | |
- name: build project | |
run: cmake --build . | |
- name: run tests | |
run: ctest | |
- name: run fastfetch --list-features | |
run: ./fastfetch --list-features | |
- name: run fastfetch | |
run: time ./fastfetch -c presets/ci | |
- name: run fastfetch --format json | |
run: time ./fastfetch -c presets/ci --format json | |
- name: run flashfetch | |
run: time ./flashfetch | |
linux: | |
name: Linux | |
runs-on: ubuntu-20.04 # 22.04 ships a newer version of glibc than debian stable, allow those people to use the debian package | |
permissions: | |
security-events: write | |
contents: read | |
outputs: | |
ffversion: ${{ steps.ffversion.outputs.ffversion }} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: uname -a | |
run: uname -a | |
- name: install required packages | |
run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libmagickcore-dev libxfconf-0-dev libsqlite3-dev rpm librpm-dev libzstd-dev libegl-dev libglx-dev libosmesa6-dev ocl-icd-opencl-dev libnm-dev libpulse-dev directx-headers-dev | |
- 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 --ignore-dependencies | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: c | |
- name: configure project | |
run: PKG_CONFIG_PATH=/home/linuxbrew/.linuxbrew/lib/pkgconfig:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_INSTALL_PREFIX=/usr . | |
- name: build project | |
run: cmake --build . --target package --verbose | |
- name: perform CodeQL analysis | |
uses: github/codeql-action/analyze@v2 | |
- name: list features | |
run: ./fastfetch --list-features | |
- name: run fastfetch | |
run: time ./fastfetch -c presets/ci | |
- name: run fastfetch --format json | |
run: time ./fastfetch -c presets/ci --format json | |
- name: run flashfetch | |
run: time ./flashfetch | |
- name: print dependencies | |
run: ldd fastfetch | |
- name: run tests | |
run: ctest | |
- name: get fastfetch version | |
id: ffversion | |
run: echo "ffversion=$(./fastfetch --version-raw)" >> $GITHUB_OUTPUT | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fastfetch-linux | |
path: ./fastfetch-*.* | |
macos: | |
name: MacOS | |
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: | | |
brew update | |
brew install vulkan-loader vulkan-headers molten-vk imagemagick chafa | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: c | |
- name: configure project | |
run: cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' . | |
- name: build project | |
run: cmake --build . --target package --verbose | |
- name: perform CodeQL analysis | |
uses: github/codeql-action/analyze@v2 | |
- name: list features | |
run: ./fastfetch --list-features | |
- name: run fastfetch | |
run: time ./fastfetch -c presets/ci | |
- name: run fastfetch --format json | |
run: time ./fastfetch -c presets/ci --format json | |
- name: run flashfetch | |
run: time ./flashfetch | |
- name: print dependencies | |
run: otool -L fastfetch | |
- name: run tests | |
run: ctest | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fastfetch-macos | |
path: ./fastfetch-*.* | |
freebsd: | |
name: FreeBSD | |
runs-on: macos-12 | |
permissions: | |
security-events: write | |
contents: read | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: run VM | |
uses: cross-platform-actions/[email protected] | |
with: | |
operating_system: freebsd | |
version: '13.2' | |
run: | | |
uname -a | |
sudo pkg update | |
sudo pkg install -y cmake git pkgconf binutils pciutils wayland vulkan-headers vulkan-loader libxcb libXrandr libX11 glib dconf dbus sqlite3-tcl xfce4-conf ImageMagick6 ImageMagick7 chafa egl libosmesa opencl ocl-icd pulseaudio | |
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . | |
cmake --build . --target package --verbose | |
./fastfetch --list-features | |
time ./fastfetch -c presets/ci | |
time ./fastfetch -c presets/ci --format json | |
time ./flashfetch | |
ldd fastfetch | |
ctest | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fastfetch-freebsd | |
path: ./fastfetch-*.* | |
win64: | |
name: Win64 | |
runs-on: windows-latest | |
permissions: | |
security-events: write | |
contents: read | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: setup-msys2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: CLANG64 | |
update: true | |
install: git mingw-w64-clang-x86_64-7zip mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-vulkan-loader mingw-w64-clang-x86_64-opencl-icd | |
- name: print msys version | |
run: uname -a | |
- name: configure project | |
run: env PKG_CONFIG_PATH=/clang64/lib/pkgconfig/:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . | |
- name: build project | |
run: cmake --build . --verbose | |
- name: copy necessary dlls | |
run: cp /clang64/bin/{OpenCL,vulkan-1}.dll . | |
- name: list features | |
run: ./fastfetch --list-features | |
- name: run fastfetch | |
run: time ./fastfetch -c presets/ci | |
- name: run fastfetch --format json | |
run: time ./fastfetch -c presets/ci --format json | |
- name: run flashfetch | |
run: time ./flashfetch | |
- name: print dependencies | |
run: ldd fastfetch | |
- name: run tests | |
run: ctest | |
- name: create zip archive | |
run: 7z a -tzip -mx9 -bd -y fastfetch-$(./fastfetch --version-raw)-Win64.zip *.dll fastfetch.exe flashfetch.exe presets | |
- name: create 7z archive | |
run: 7z a -t7z -mx9 -bd -y fastfetch-$(./fastfetch --version-raw)-Win64.7z *.dll fastfetch.exe flashfetch.exe presets | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fastfetch-win64 | |
path: ./fastfetch-*-Win64.* | |
win32: | |
name: Win32 | |
runs-on: windows-latest | |
permissions: | |
security-events: write | |
contents: read | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: setup-msys2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: CLANG32 | |
update: true | |
install: git mingw-w64-clang-i686-7zip mingw-w64-clang-i686-cmake mingw-w64-clang-i686-clang mingw-w64-clang-i686-vulkan-loader mingw-w64-clang-i686-opencl-icd | |
- name: print msys version | |
run: uname -a | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: c, cpp | |
- name: configure project | |
run: env PKG_CONFIG_PATH=/clang32/lib/pkgconfig/:$PKG_CONFIG_PATH cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . | |
- name: build project | |
run: cmake --build . --verbose | |
- name: perform CodeQL analysis | |
uses: github/codeql-action/analyze@v2 | |
- name: copy necessary dlls | |
run: cp /clang32/bin/{OpenCL,vulkan-1}.dll . | |
- name: run fastfetch | |
run: time ./fastfetch -c presets/ci | |
- name: run fastfetch --format json | |
run: time ./fastfetch -c presets/ci --format json | |
- name: run flashfetch | |
run: time ./flashfetch | |
- name: print dependencies | |
run: ldd fastfetch | |
- name: run tests | |
run: ctest | |
- name: create zip archive | |
run: 7z a -tzip -mx9 -bd -y fastfetch-$(./fastfetch --version-raw)-Win32.zip *.dll fastfetch.exe flashfetch.exe presets | |
- name: create 7z archive | |
run: 7z a -t7z -mx9 -bd -y fastfetch-$(./fastfetch --version-raw)-Win32.7z *.dll fastfetch.exe flashfetch.exe presets | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: fastfetch-win32 | |
path: ./fastfetch-*-Win32.* | |
release: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'fastfetch-cli/fastfetch' | |
name: Release | |
runs-on: ubuntu-latest | |
needs: | |
- linux | |
- macos | |
- freebsd | |
- win64 | |
- win32 | |
permissions: | |
contents: write | |
steps: | |
- name: download artifacts | |
uses: actions/download-artifact@v3 | |
- name: get latest release version | |
id: get_version_release | |
uses: pozetroninc/github-action-get-latest-release@master | |
with: | |
repository: ${{ github.repository }} | |
- name: create release | |
if: needs.linux.outputs.ffversion != steps.get_version_release.outputs.release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ needs.linux.outputs.ffversion }} | |
commit: ${{ github.sha }} | |
artifactErrorsFailBuild: true | |
artifacts: fastfetch-linux/*,fastfetch-macos/*,fastfetch-freebsd/*,fastfetch-win64/*,fastfetch-win32/* |