-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (93 loc) · 3.83 KB
/
build-libfp-linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Linux - Build libfp
on:
workflow_call:
secrets:
qt_ffynnon_cred:
description: 'Credentials for getting Qt from Ffynnon'
required: true
env:
qt_install_dir: ${{ github.workspace }}/Qt/Install
libfp_src_suffix: libfp/Source
libfp_src_dir: ${{ github.workspace }}/libfp/Source
libfp_build_dir: ${{ github.workspace }}/libfp/Build
jobs:
build-libfp:
name: Build libfp - Linux (Release)
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
compiler: [{c: gcc-12, cxx: g++-12, qt: clang14}, {c: clang-12, cxx: clang++-12, qt: clang12}, {c: clang-14, cxx: clang++-14, qt: clang14}]
linkage: [{type: shared, cmake_bsl: ON}, {type: static, cmake_bsl: OFF}]
exclude:
- os: ubuntu-20.04
compiler: {c: gcc-12, cxx: g++-12, qt: clang14}
- os: ubuntu-20.04
compiler: {c: clang-14, cxx: clang++-14, qt: clang14}
- os: ubuntu-22.04
compiler: {c: clang-12, cxx: clang++-12, qt: clang12}
runs-on: ${{ matrix.os }}
env:
cmake_gen: Ninja Multi-Config
steps:
- name: Set derived variables with shell because GitHub Actions env context sucks
run: |
echo "libfp_package_path=${{ env.libfp_build_dir }}/out/dist" >> $GITHUB_ENV
libfp_install_path="${{ env.libfp_build_dir }}/out/install"
echo "libfp_install_path=$libfp_install_path" >> $GITHUB_ENV
echo "qt_cmake=$qt_install_dir/bin/qt-cmake" >> $GITHUB_ENV
- name: Install Qt (custom build)
uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev
with:
version: 6.6.0
os: linux
compiler: ${{ matrix.compiler.qt }}
linkage: ${{ matrix.linkage.type }}
path: ${{ env.qt_install_dir }}
credentials: ${{ secrets.qt_ffynnon_cred }}
- name: Update package index
run: sudo apt-get update
- name: Install OpenGL lib
run: sudo apt-get install libglu1-mesa-dev
- name: Install XCB-XKB
run: sudo apt-get install libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-*-dev
- name: Install Ninja
run: sudo apt-get install ninja-build
- name: Install Harfbuzz
run: sudo apt-get install libharfbuzz-dev
- name: Install EGL [22.04]
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get install libegl1-mesa-dev
- name: Install Wayland [22.04]
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get install libwayland-dev
- name: Checkout libfp
uses: actions/checkout@v4
with:
path: ${{ env.libfp_src_suffix }}
fetch-depth: 0 # Required for verbose versioning to work correctly
- name: Build/Install libfp
working-directory: ${{ env.libfp_src_dir }}
run: |
echo Configuring CMake...
"$qt_cmake" -G "$cmake_gen" -S "$libfp_src_dir" -B "$libfp_build_dir" -D BUILD_SHARED_LIBS="${{ matrix.linkage.cmake_bsl }}" -D CMAKE_CXX_COMPILER="${{ matrix.compiler.cxx }}" -D CMAKE_C_COMPILER="${{ matrix.compiler.c }}"
echo Changing to build directory...
cd "$libfp_build_dir"
echo Building libfp release...
cmake --build . --target all --config Release
echo Installing libfp Release
cmake --install . --config Release
echo Packaging libfp...
cpack -C "Release"
echo Build complete.
- name: Get libfp artifact name
run: |
cpack_name=$(find "${{ env.libfp_package_path }}" -type f -name "*.zip")
artifact_name="$(basename "$cpack_name" .zip) [${{ matrix.compiler.cxx }}]"
echo "current_artifact_name=$artifact_name" >> $GITHUB_ENV
- name: Upload libfp build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.current_artifact_name }}
path: ${{ env.libfp_install_path }}
if-no-files-found: error