Skip to content

Commit

Permalink
Add Ubuntu 24.04 + Qt 6 workflow & update C++ standard to C++17
Browse files Browse the repository at this point in the history
Attempt to fix FreeBSD versions

Attempt to fix FreeBSD version mappings

Try to build onle on 13.2

Fix matrix

Let FreeBSD CI run on Ubuntu 22.04

Do not fail if one of the FreeBSD failed

Fix efivar not defined check

Add link
  • Loading branch information
Integral-Tech authored and Inokinoki committed Nov 10, 2024
1 parent 05c09b4 commit 36deb86
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 11 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/cmake-freebsd-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build on FreeBSD

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
name: Build
runs-on: ubuntu-22.04
strategy:
matrix:
os-version: ['13.2', '14.1']
# Don't abort runners if a single one fails
fail-fast: false

steps:
- uses: actions/checkout@v2
with:
submodules: true

# Configure and build
- uses: vmactions/freebsd-vm@v1
with:
release: ${{ matrix.os-version}}
usesh: true
prepare: |
pkg install -y cmake qt5 pkgconf efivar gcc
run: |
uname -a
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DPATCH_FREEBSD_EFIVAR=ON -DCMAKE_CXX_COMPILER=g++
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
20 changes: 16 additions & 4 deletions .github/workflows/cmake-linux-amd64-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ jobs:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04
name: Build
strategy:
matrix:
include:
- os: ubuntu-20.04
qt-ver: 5
qt-pkg: qtbase5-dev
- os: ubuntu-24.04
qt-ver: 6
qt-pkg: qt6-base-dev
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v2
Expand All @@ -28,7 +38,7 @@ jobs:
- name: Install libefivar, libefiboot and their dev files
run: |
sudo apt update -y
sudo apt install -y libefivar-dev libefiboot-dev qt5-default
sudo apt install -y libefivar-dev libefiboot-dev ${{matrix.qt-pkg}} fuse
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand All @@ -44,16 +54,18 @@ jobs:
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
export QMAKE=/usr/lib/qt${{matrix.qt-ver}}/bin/qmake
make install DESTDIR=AppDir
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage
mv EFI_Entry_Manager-x86_64.AppImage EFI_Entry_Manager-x86_64-Qt${{matrix.qt-ver}}.AppImage
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: QEFI Entry Manager x86_64 AppImage
name: QEFI Entry Manager x86_64 AppImage Qt${{matrix.qt-ver}}
# A file, directory or wildcard pattern that describes what to upload
path: ${{github.workspace}}/build/EFI_Entry_Manager*.AppImage
path: ${{github.workspace}}/build/EFI_Entry_Manager-x86_64-Qt${{matrix.qt-ver}}.AppImage
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets Network REQUIRED)
Expand Down Expand Up @@ -59,7 +59,16 @@ endif()
# Find and link efivar/win32 API
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(EFIVAR efivar)
pkg_check_modules(EFIVAR efivar>=0.15)
if(NOT DEFINED EFIVAR_FOUND)
# Find and link efivar<0.15
pkg_check_modules(EFIVAR efivar)
if(EFIVAR_FOUND)
# Consider it as an old lib (without mode and return non-zero)
# TODO(Inoki): to check https://github.com/rhboot/efivar/commit/7bd2e309aeec210509d215c803a762725591ccc7
add_definitions(-DEFIVAR_OLD_API)
endif()
endif()
endif()

if(APP_DATA_DUMMY_BACKEND)
Expand All @@ -76,13 +85,10 @@ else()
message(FATAL_ERROR "No EFI utility found, please make sure you have libefivar installed")
endif()

if(USE_EFIVAR_OLD_API)
add_definitions(-DEFIVAR_OLD_API)
endif()

target_include_directories(QEFIEntryManager PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/qefivar)
if(PATCH_FREEBSD_EFIVAR)
# Patch efivar build for FreeBSD
# Patch efivar 0.15 build for FreeBSD
# TODO(Inoki): check 0.15 build
add_definitions(-DEFIVAR_FREEBSD_PATCH)
target_link_libraries(QEFIEntryManager PRIVATE geom)
endif()
Expand Down

0 comments on commit 36deb86

Please sign in to comment.