mirror of
https://github.com/ashaduri/gsmartcontrol.git
synced 2026-09-24 21:05:38 +00:00
250 lines
7.5 KiB
YAML
250 lines
7.5 KiB
YAML
name: Build (Tier 1 platforms)
|
|
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the main branch
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
|
|
env:
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
BUILD_TYPE: RelWithDebInfo
|
|
SMARTMONTOOLS_INSTALLER: smartmontools-7.4-1.win32-setup.exe
|
|
SMARTMONTOOLS_URL: https://downloads.sourceforge.net/project/smartmontools/smartmontools/7.4/smartmontools-7.4-1.win32-setup.exe
|
|
|
|
|
|
jobs:
|
|
|
|
linux-ubuntu-24_04:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Update Package Database
|
|
run: sudo apt-get update
|
|
|
|
- name: Install Dependencies
|
|
run: sudo apt-get install libgtkmm-3.0-dev gettext
|
|
|
|
- name: Create Build Directory
|
|
run: cmake -E make_directory build
|
|
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
env:
|
|
CC: gcc-14
|
|
CXX: g++-14
|
|
run: >
|
|
cmake $GITHUB_WORKSPACE
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
-DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/toolchains/linux-dev.cmake"
|
|
|
|
- name: Build
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
- name: Test
|
|
working-directory: ${{github.workspace}}/build
|
|
shell: bash
|
|
run: ctest -C $BUILD_TYPE --rerun-failed --output-on-failure
|
|
|
|
- name: Pack (cmake install and make binary package)
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cpack -G TBZ2
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Linux Packages
|
|
path: ${{github.workspace}}/build/gsmartcontrol-*-Linux*.*
|
|
|
|
|
|
linux-ubuntu-22_04:
|
|
# GCC 11
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Update Package Database
|
|
run: sudo apt-get update
|
|
|
|
- name: Install Dependencies
|
|
run: sudo apt-get install libgtkmm-3.0-dev gettext
|
|
|
|
- name: Create Build Directory
|
|
run: cmake -E make_directory build
|
|
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
env:
|
|
CC: gcc-11
|
|
CXX: g++-11
|
|
run: >
|
|
cmake $GITHUB_WORKSPACE
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
-DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/toolchains/linux-dev.cmake"
|
|
|
|
- name: Build
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
- name: Test
|
|
working-directory: ${{github.workspace}}/build
|
|
shell: bash
|
|
run: ctest -C $BUILD_TYPE --rerun-failed --output-on-failure
|
|
|
|
- name: Pack (cmake install and make binary package)
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cpack -G TBZ2
|
|
|
|
# - name: Upload artifacts
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: Linux Packages
|
|
# path: ${{github.workspace}}/build/gsmartcontrol-*-Linux*.*
|
|
|
|
|
|
windows-msys2:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
include: [
|
|
{ msystem: MINGW64, arch: x86_64, platform: win64, urlpath: mingw64 },
|
|
# MSYS2 no longer supports for 32-bit Windows.
|
|
# { msystem: MINGW32, arch: i686, platform: win32, urlpath: mingw32 }
|
|
]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
# p7zip is needed to extract smartmontools
|
|
# fontconfig owns /etc/fonts
|
|
with:
|
|
msystem: ${{ matrix.msystem }}
|
|
update: true
|
|
install: >-
|
|
mingw-w64-${{ matrix.arch }}-gtkmm3
|
|
mingw-w64-${{ matrix.arch }}-pkg-config
|
|
mingw-w64-${{ matrix.arch }}-cmake
|
|
mingw-w64-${{ matrix.arch }}-gcc
|
|
mingw-w64-${{ matrix.arch }}-fontconfig
|
|
mingw-w64-${{ matrix.arch }}-nsis
|
|
make
|
|
p7zip
|
|
|
|
- name: Downgrade Packages to support Windows 7
|
|
# librsvg 2.59 requires Windows 8.1 or later (confirmed by dependency walker).
|
|
# We need to downgrade to 2.58.
|
|
# This contains gdk_pixbuf loader as well, and re-runs the loader cache update.
|
|
# https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-librsvg-2.58.0-1-any.pkg.tar.zst
|
|
# https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-librsvg-2.58.0-1-any.pkg.tar.zst
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}
|
|
run: |
|
|
wget https://repo.msys2.org/mingw/${{ matrix.urlpath }}/mingw-w64-${{ matrix.arch }}-librsvg-2.58.0-1-any.pkg.tar.zst
|
|
pacman -U --noconfirm mingw-w64-${{ matrix.arch }}-librsvg-2.58.0-1-any.pkg.tar.zst
|
|
|
|
- name: Download Package Requirements
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}
|
|
run: |
|
|
mkdir -p build/smartmontools
|
|
cd build/smartmontools
|
|
wget $SMARTMONTOOLS_URL
|
|
|
|
- name: Extract Package Requirements (64-bit)
|
|
if: ${{ matrix.msystem == 'MINGW64' }}
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}/build/smartmontools
|
|
run: >
|
|
7z -bb1 e $SMARTMONTOOLS_INSTALLER
|
|
bin/smartctl.exe
|
|
bin/smartctl-nc.exe
|
|
bin/update-smart-drivedb.ps1
|
|
bin/drivedb.h
|
|
|
|
- name: Extract Package Requirements (32-bit)
|
|
if: ${{ matrix.msystem == 'MINGW32' }}
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}/build/smartmontools
|
|
run: >
|
|
7z -bb1 e $SMARTMONTOOLS_INSTALLER
|
|
bin32/smartctl.exe
|
|
bin32/smartctl-nc.exe
|
|
bin/update-smart-drivedb.ps1
|
|
bin/drivedb.h
|
|
|
|
- name: List installed files
|
|
shell: msys2 {0}
|
|
run: |
|
|
ls -1R /mingw64
|
|
ls -1R /mingw32
|
|
|
|
- name: List Files in Workspace
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}
|
|
run: ls -1R .
|
|
|
|
- name: Configure CMake
|
|
shell: msys2 {0}
|
|
run: >
|
|
cmake -B build -S "$GITHUB_WORKSPACE"
|
|
-G "MSYS Makefiles"
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
-DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/toolchains/${{ matrix.platform }}-mingw-msys2.cmake"
|
|
|
|
- name: Build
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
- name: Test
|
|
working-directory: ${{github.workspace}}/build
|
|
shell: msys2 {0}
|
|
run: ctest -C $BUILD_TYPE --rerun-failed --output-on-failure
|
|
|
|
- name: Package ZIP
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cpack -G ZIP
|
|
|
|
- name: Package NSIS (64-bit)
|
|
if: ${{ matrix.msystem == 'MINGW64' }}
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cpack -G NSIS64
|
|
|
|
- name: Package NSIS (32-bit)
|
|
if: ${{ matrix.msystem == 'MINGW32' }}
|
|
shell: msys2 {0}
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cpack -G NSIS
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ matrix.msystem == 'MINGW64' }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Windows 64-Bit Packages
|
|
path: ${{github.workspace}}/build/gsmartcontrol-*-win*.*
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ matrix.msystem == 'MINGW32' }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Windows 32-Bit Packages
|
|
path: ${{github.workspace}}/build/gsmartcontrol-*-win*.*
|
|
|