[Build] Improve CI build coverage

This reworks the CI coverage to add `TRANSLATIONS_ONLY=ON` and libretro
builds to GitHub Actions.
This commit is contained in:
Fabrice de Gans 2024-04-01 21:02:19 -07:00 committed by Rafael Kitover
parent 3518dc6a05
commit db08ca93af
6 changed files with 126 additions and 43 deletions

View File

@ -1,27 +1,51 @@
name: macOS Latest Build name: macOS Latest Build
on: [push, pull_request] on: [push, pull_request]
#on: workflow_dispatch
jobs: jobs:
build: build:
strategy: strategy:
matrix: matrix:
cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug'] build_type: [release, debug]
cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON'] build_options: [default, link_off, translations_only, libretro]
include:
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
build_options: translations_only
- libretro_build: 'DEBUG=0'
build_type: release
build_options: libretro
- libretro_build: 'DEBUG=1'
build_type: debug
build_options: libretro
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: Checkout the code - name: Checkout the code
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Install nix - name: Install nix
uses: cachix/install-nix-action@v22 uses: cachix/install-nix-action@v22
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- name: Configure
# Cmake build
- if: matrix.build_options != 'libretro'
name: Configure CMake
run: >- run: >-
nix-shell --command 'cmake -B build -G Ninja ${{ matrix.cmake_build }} -DENABLE_LTO=OFF ${{ matrix.cmake_options }}' nix-shell --command 'cmake -B build -G Ninja ${{ matrix.cmake_build }} -DENABLE_LTO=OFF ${{ matrix.cmake_options }}'
- name: Build - if: matrix.build_options != 'libretro'
name: Build
run: >- run: >-
nix-shell --command 'ninja -C build' nix-shell --command 'ninja -C build'
# Libretro build
- if: matrix.build_options == 'libretro'
name: Build libretro core
run: >-
nix-shell --command 'make -C src/libretro ${{ matrix.libretro_build }}'

View File

@ -5,8 +5,23 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug'] build_type: [release, debug]
cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON'] build_options: [default, link_off, translations_only, libretro]
include:
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
build_options: translations_only
- libretro_build: 'DEBUG=0'
build_type: release
build_options: libretro
- libretro_build: 'DEBUG=1'
build_type: debug
build_options: libretro
runs-on: windows-latest runs-on: windows-latest
env: env:
MSYSTEM: CLANG64 MSYSTEM: CLANG64
@ -16,7 +31,7 @@ jobs:
steps: steps:
- name: Checkout the code - name: Checkout the code
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Setup msys2 - name: Setup msys2
@ -27,11 +42,19 @@ jobs:
- name: Install deps - name: Install deps
run: >- run: >-
bash installdeps bash installdeps
- name: Configure
run: >-
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
- name: Build
run: ninja -C build
- name: Install # CMake build
- if: matrix.build_options != 'libretro'
name: Configure CMake
run: cmake -B build -G Ninja ${{ matrix.cmake_build }} -DENABLE_LTO=OFF ${{ matrix.cmake_options }}
- if: matrix.build_options != 'libretro'
name: Build
run: ninja -C build
- if: matrix.build_options != 'libretro'
name: Install
run: ninja -C build install run: ninja -C build install
# Libretro build
- if: matrix.build_options == 'libretro'
name: Build libretro core
run: make -C src/libretro ${{ matrix.libretro_build }} CC=clang CXX=clang++

View File

@ -5,26 +5,52 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
cmake_compiler: ['-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++', '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++'] build_compiler: [gcc, clang]
cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug'] build_type: [release, debug]
cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON'] build_options: [default, link_off, translations_only, libretro]
include:
- cmake_compiler: '-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++'
build_compiler: gcc
- cmake_compiler: '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++'
build_compiler: clang
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
build_options: translations_only
- libretro_build: 'DEBUG=0'
build_type: release
build_options: libretro
- libretro_build: 'DEBUG=1'
build_type: debug
build_options: libretro
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout the code - name: Checkout the code
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Install Dependencies - name: Install Dependencies
run: >- run: >-
bash installdeps; if [ "${{ matrix.compiler }}" = clang ]; then sudo apt -y install clang; fi bash installdeps; if [ "${{ matrix.build_compiler }}" = clang ]; then sudo apt -y install clang; fi
- name: Configure # CMake build
- if: matrix.build_options != 'libretro'
name: Configure CMake
run: >- run: >-
cmake -B build -G Ninja ${{ matrix.cmake_compiler }} ${{ matrix.cmake_build }} ${{ matrix.cmake_options }} cmake -B build -G Ninja ${{ matrix.cmake_compiler }} ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
- if: matrix.build_options != 'libretro'
- name: Build name: Build
run: ninja -C build run: ninja -C build
- if: matrix.build_options != 'libretro'
- name: Install name: Install
run: sudo ninja -C build install run: sudo ninja -C build install
# Libretro build
- name: Build libretro core
if: matrix.build_options == 'libretro'
run: make -C src/libretro ${{ matrix.libretro_build }}

View File

@ -5,32 +5,46 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
msvc_arch: ['x64', 'x64_x86'] msvc_arch: ['x64', 'amd64_x86', 'amd64_arm64']
# TODO: Re-add "Visual Studio 17 2022" once it's working.
cmake_generator: ['Ninja'] cmake_generator: ['Ninja']
# cmake_generator: ['Ninja', '"Visual Studio 17 2022"'] build_type: [release, debug]
cmake_build: ['-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_BUILD_TYPE=Debug'] build_options: [default, link_off, translations_only]
cmake_options: ['', '-DENABLE_LINK=OFF', '-DENABLE_SDL=ON'] include:
- cmake_build: '-DCMAKE_BUILD_TYPE=Release'
build_type: release
- cmake_build: '-DCMAKE_BUILD_TYPE=Debug'
build_type: debug
- cmake_options: '-DENABLE_LINK=OFF'
build_options: link_off
- cmake_options: '-DTRANSLATIONS_ONLY=ON'
build_options: translations_only
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout the code - name: Checkout the code
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Prepare Visual Studio environment - name: Prepare Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1.12.0 uses: ilammy/msvc-dev-cmd@v1.13.0
with: with:
arch: ${{ matrix.msvc_arch }} arch: ${{ matrix.msvc_arch }}
- name: Configure (x64) - if: matrix.msvc_arch == 'x64'
if: matrix.msvc_arch == 'x64' name: Configure (x64)
run: >- run: >-
cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=x64-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }} cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=x64-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
- name: Configure (x86) - if: matrix.msvc_arch == 'amd64_x86'
if: matrix.msvc_arch == 'x64_x86' name: Configure (x86)
run: >- run: >-
cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=x86-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }} cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=x86-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
- if: matrix.msvc_arch == 'amd64_arm64'
name: Configure (arm64)
run: >-
cmake -B build -G ${{ matrix.cmake_generator }} -DVCPKG_TARGET_TRIPLET=arm64-windows-static ${{ matrix.cmake_build }} ${{ matrix.cmake_options }}
- name: Build - name: Build
run: cmake --build build run: cmake --build build

View File

@ -66,7 +66,7 @@ endif
ifneq (,$(findstring unix,$(platform))) ifneq (,$(findstring unix,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC fpic := -fPIC
SHARED := -shared -Wl,-version-script=$(LIBRETRO_DIR)/link.T -Wl,-no-undefined SHARED := -shared -Wl,-no-undefined
TILED_RENDERING=1 TILED_RENDERING=1
# Classic Platforms #################### # Classic Platforms ####################
@ -78,7 +78,7 @@ ifneq (,$(findstring unix,$(platform)))
else ifeq ($(platform), classic_armv7_a7) else ifeq ($(platform), classic_armv7_a7)
TARGET := $(TARGET_NAME)_libretro.so TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC fpic := -fPIC
SHARED := -shared -Wl,--version-script=$(LIBRETRO_DIR)/link.T -Wl,--no-undefined -fPIC SHARED := -shared -Wl,--no-undefined -fPIC
CFLAGS += -Ofast \ CFLAGS += -Ofast \
-flto=4 -fwhole-program -fuse-linker-plugin \ -flto=4 -fwhole-program -fuse-linker-plugin \
-fdata-sections -ffunction-sections -Wl,--gc-sections \ -fdata-sections -ffunction-sections -Wl,--gc-sections \
@ -216,7 +216,7 @@ else ifeq ($(platform), theos_ios)
else ifeq ($(platform), qnx) else ifeq ($(platform), qnx)
TARGET := $(TARGET_NAME)_libretro_$(platform).so TARGET := $(TARGET_NAME)_libretro_$(platform).so
fpic := -fPIC fpic := -fPIC
SHARED := -lcpp -lm -shared -Wl,-version-script=$(LIBRETRO_DIR)/link.T -Wl,-no-undefined SHARED := -lcpp -lm -shared -Wl,-no-undefined
CC = qcc -Vgcc_ntoarmv7le CC = qcc -Vgcc_ntoarmv7le
CXX = QCC -Vgcc_ntoarmv7le_cpp CXX = QCC -Vgcc_ntoarmv7le_cpp
AR = QCC -Vgcc_ntoarmv7le AR = QCC -Vgcc_ntoarmv7le
@ -527,7 +527,7 @@ else
TARGET := $(TARGET_NAME)_libretro.dll TARGET := $(TARGET_NAME)_libretro.dll
CC ?= gcc CC ?= gcc
CXX ?= g++ CXX ?= g++
SHARED := -shared -static-libgcc -static-libstdc++ -Wl,-no-undefined -Wl,-version-script=$(LIBRETRO_DIR)/link.T SHARED := -shared -static-libgcc -static-libstdc++ -Wl,-no-undefined
TILED_RENDERING=1 TILED_RENDERING=1
endif endif

View File

@ -1,4 +0,0 @@
{
global: retro_*;
local: *;
};