mirror of
https://github.com/fltk/fltk.git
synced 2026-08-18 00:48:43 +08:00
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-wayland-arm64 (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled
Build and Test / build-windows-arm (push) Has been cancelled
Thanks to Gonzalo for his proposals. This commit may be extended or modified later if considered useful. - reformat instructions for better readability - reorder prerequisites and CMake instructions for consistency across build types - use Ninja to build where appropriate - add libjpeg dependency where missing - add workflow_dispatch and daily run at 04:00 UTC - add ARM platform build types. Note: the latter is experimental and subject to change, see comments on issue 1457.
285 lines
8.4 KiB
YAML
285 lines
8.4 KiB
YAML
name: Build and Test
|
|
|
|
# This CI config file is used for the following actions. Some jobs are
|
|
# only executed for specific action types (see below, "if: ..."),
|
|
# whereas basic builds are executed on all triggers, including 'push'.
|
|
|
|
on:
|
|
push:
|
|
schedule:
|
|
# Runs at 04:00 UTC every day
|
|
- cron: '0 4 * * *'
|
|
workflow_dispatch: # Allows manual execution
|
|
|
|
env:
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
BUILD_TYPE: Release
|
|
|
|
permissions:
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
# Note: the CMake configure and build commands are platform agnostic and
|
|
# should work equally well on all supported platforms. You can convert this
|
|
# to a matrix build if you need (more) cross-platform coverage.See:
|
|
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
|
|
|
jobs:
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: install prerequisites
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y \
|
|
libjpeg-dev \
|
|
libasound2-dev \
|
|
libglew-dev \
|
|
libglu1-mesa-dev \
|
|
libcairo2-dev \
|
|
libx11-dev \
|
|
libxcursor-dev \
|
|
libxft-dev \
|
|
libxinerama-dev \
|
|
ninja-build
|
|
|
|
- name: Create Build Environment
|
|
# Create a separate build directory.
|
|
# We'll use this as our working directory for all subsequent commands
|
|
run: cmake -E make_directory ${{github.workspace}}/build
|
|
|
|
- name: Configure CMake
|
|
# Use a bash shell on all platforms but Windows, so we can use the same syntax
|
|
# for environment variable access regardless of the host operating system
|
|
shell: bash
|
|
# Note the current convention is to use the -S and -B options here to specify
|
|
# source and build directories, but we set the working directory explicitly
|
|
working-directory: ${{github.workspace}}/build
|
|
|
|
run: |
|
|
cmake $GITHUB_WORKSPACE \
|
|
-G Ninja \
|
|
-D CMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
-D CMAKE_CXX_STANDARD=11 \
|
|
-D CMAKE_CXX_EXTENSIONS=OFF \
|
|
-D CMAKE_C_FLAGS_INIT="-Wall -Wunused" \
|
|
-D CMAKE_CXX_FLAGS_INIT="-Wall -Wunused -Wsuggest-override" \
|
|
-D FLTK_BACKEND_WAYLAND=OFF \
|
|
-D FLTK_BUILD_SHARED_LIBS:BOOL=ON \
|
|
-D FLTK_BUILD_FORMS=ON \
|
|
-D FLTK_OPTION_CAIRO_WINDOW=OFF
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
shell: bash
|
|
# Execute the build.
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
- name: Unittest
|
|
working-directory: ${{github.workspace}}/build
|
|
shell: bash
|
|
run: ./bin/test/unittests --core
|
|
|
|
build-wayland:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Install prerequisites
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y \
|
|
libjpeg-dev \
|
|
libasound2-dev \
|
|
libglu1-mesa-dev \
|
|
libcairo2-dev \
|
|
libwayland-dev \
|
|
wayland-protocols \
|
|
libdbus-1-dev \
|
|
libxkbcommon-dev \
|
|
libegl-dev \
|
|
libopengl-dev \
|
|
libpango1.0-dev \
|
|
libdecor-0-dev \
|
|
libxfixes-dev \
|
|
libxcursor-dev \
|
|
libxinerama-dev \
|
|
ninja-build
|
|
|
|
- name: Create Build Environment
|
|
run: cmake -E make_directory ${{github.workspace}}/build
|
|
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
|
|
run: |
|
|
cmake $GITHUB_WORKSPACE \
|
|
-G Ninja \
|
|
-D CMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
-D CMAKE_CXX_STANDARD=11 \
|
|
-D CMAKE_CXX_EXTENSIONS=OFF \
|
|
-D CMAKE_C_FLAGS_INIT="-Wall -Wunused" \
|
|
-D CMAKE_CXX_FLAGS_INIT="-Wall -Wunused -Wsuggest-override" \
|
|
-D FLTK_BUILD_SHARED_LIBS:BOOL=ON \
|
|
-D FLTK_BUILD_FORMS=ON \
|
|
-D FLTK_OPTION_CAIRO_WINDOW=ON
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
shell: bash
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
build-wayland-arm64:
|
|
# Don't run this job on 'push' events:
|
|
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
|
|
|
|
runs-on: ubuntu-24.04-arm
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Install prerequisites
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y \
|
|
libjpeg-dev \
|
|
libasound2-dev \
|
|
libglu1-mesa-dev \
|
|
libcairo2-dev \
|
|
libwayland-dev \
|
|
wayland-protocols \
|
|
libdbus-1-dev \
|
|
libxkbcommon-dev \
|
|
libegl-dev \
|
|
libopengl-dev \
|
|
libpango1.0-dev \
|
|
libdecor-0-dev \
|
|
libxfixes-dev \
|
|
libxcursor-dev \
|
|
libxinerama-dev \
|
|
ninja-build
|
|
|
|
- name: Create Build Environment
|
|
run: cmake -E make_directory ${{github.workspace}}/build
|
|
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
run: |
|
|
cmake $GITHUB_WORKSPACE \
|
|
-G Ninja \
|
|
-D CMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
-D CMAKE_CXX_STANDARD=11 \
|
|
-D CMAKE_CXX_EXTENSIONS=OFF \
|
|
-D CMAKE_C_FLAGS_INIT="-Wall -Wunused" \
|
|
-D CMAKE_CXX_FLAGS_INIT="-Wall -Wunused -Wsuggest-override" \
|
|
-D FLTK_BUILD_SHARED_LIBS:BOOL=ON \
|
|
-D FLTK_BUILD_FORMS=ON \
|
|
-D FLTK_OPTION_CAIRO_WINDOW=ON
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
shell: bash
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
# note: `brew install ninja` is not necessary because it's already installed
|
|
# on current macOS CI images. Therefore the following lines are commented out.
|
|
# We may need this though if GitHub changes their CI runner images.
|
|
|
|
# - name: Install prerequisites
|
|
# run: |
|
|
# brew install ninja
|
|
|
|
- name: Create Build Environment
|
|
run: cmake -E make_directory ${{github.workspace}}/build
|
|
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{github.workspace}}/build
|
|
|
|
run: |
|
|
cmake $GITHUB_WORKSPACE \
|
|
-G Ninja \
|
|
-D CMAKE_BUILD_TYPE=$BUILD_TYPE \
|
|
-D CMAKE_CXX_STANDARD=11 \
|
|
-D CMAKE_CXX_EXTENSIONS=OFF \
|
|
-D CMAKE_C_FLAGS_INIT="-Wall -Wunused" \
|
|
-D CMAKE_CXX_FLAGS_INIT="-Wall -Wunused -Wsuggest-override" \
|
|
-D FLTK_BUILD_SHARED_LIBS:BOOL=ON \
|
|
-D FLTK_BUILD_FORMS=ON
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
shell: bash
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
build-windows:
|
|
# This build config has been minimized. Please see other configs for further advice.
|
|
# We don't use the "bash" shell (defaults to PowerShell) and avoid using environment
|
|
# variables as far as possible and useful.
|
|
#
|
|
# Note:
|
|
# We *must* disable system image libs for all Windows builds to make sure we don't
|
|
# find incompatible ones on GitHub Actions runners for Windows.
|
|
|
|
# This job must use the Visual Studio IDE and toolchain
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Create Build Environment
|
|
run: cmake -E make_directory ${{github.workspace}}/build
|
|
|
|
- name: Configure CMake
|
|
working-directory: ${{github.workspace}}/build
|
|
run: |
|
|
cmake .. `
|
|
-D FLTK_USE_SYSTEM_LIBJPEG:BOOL=OFF `
|
|
-D FLTK_USE_SYSTEM_LIBPNG:BOOL=OFF `
|
|
-D FLTK_USE_SYSTEM_ZLIB:BOOL=OFF `
|
|
-D FLTK_BUILD_FORMS=ON `
|
|
-D FLTK_BUILD_SHARED_LIBS:BOOL=ON
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cmake --build . --config Release
|
|
|
|
build-windows-arm:
|
|
# Don't run this job on 'push' events:
|
|
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
|
|
|
|
# Note: For details see above (job "build-windows")
|
|
runs-on: windows-11-arm
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Create Build Environment
|
|
run: cmake -E make_directory ${{github.workspace}}/build
|
|
|
|
- name: Configure CMake
|
|
working-directory: ${{github.workspace}}/build
|
|
run: |
|
|
cmake .. `
|
|
-D FLTK_USE_SYSTEM_LIBJPEG:BOOL=OFF `
|
|
-D FLTK_USE_SYSTEM_LIBPNG:BOOL=OFF `
|
|
-D FLTK_USE_SYSTEM_ZLIB:BOOL=OFF `
|
|
-D FLTK_BUILD_FORMS=ON `
|
|
-D FLTK_BUILD_SHARED_LIBS:BOOL=ON
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cmake --build . --config Release
|