2024-05-13 21:14:38 +00:00
|
|
|
name: macOS Latest
|
2023-09-05 17:23:29 +00:00
|
|
|
on: [push, pull_request]
|
2022-10-16 18:22:37 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-09-04 22:55:51 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-02 04:02:19 +00:00
|
|
|
build_type: [release, debug]
|
|
|
|
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
|
2024-04-02 17:51:17 +00:00
|
|
|
exclude:
|
|
|
|
# Exclude debug/translations_only build
|
|
|
|
- build_type: debug
|
|
|
|
build_options: translations_only
|
2022-10-16 18:22:37 +00:00
|
|
|
runs-on: macos-latest
|
2024-04-16 15:30:30 +00:00
|
|
|
env:
|
|
|
|
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM: 1
|
2022-10-16 18:22:37 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout the code
|
2024-04-02 04:02:19 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-10-16 18:22:37 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2023-09-05 17:23:29 +00:00
|
|
|
- name: Install nix
|
|
|
|
uses: cachix/install-nix-action@v22
|
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2024-04-02 04:02:19 +00:00
|
|
|
|
|
|
|
# Cmake build
|
|
|
|
- if: matrix.build_options != 'libretro'
|
|
|
|
name: Configure CMake
|
2022-10-16 18:22:37 +00:00
|
|
|
run: >-
|
2024-03-11 08:53:47 +00:00
|
|
|
nix-shell --command 'cmake -B build -G Ninja ${{ matrix.cmake_build }} -DENABLE_LTO=OFF ${{ matrix.cmake_options }}'
|
2024-04-02 04:02:19 +00:00
|
|
|
- if: matrix.build_options != 'libretro'
|
|
|
|
name: Build
|
2023-09-05 17:23:29 +00:00
|
|
|
run: >-
|
|
|
|
nix-shell --command 'ninja -C build'
|
2024-04-02 04:02:19 +00:00
|
|
|
|
|
|
|
# Libretro build
|
|
|
|
- if: matrix.build_options == 'libretro'
|
|
|
|
name: Build libretro core
|
|
|
|
run: >-
|
|
|
|
nix-shell --command 'make -C src/libretro ${{ matrix.libretro_build }}'
|
2024-05-06 04:28:55 +00:00
|
|
|
|
|
|
|
# Run tests
|
|
|
|
- if: matrix.build_options == 'default'
|
|
|
|
name: Run tests
|
|
|
|
run: >-
|
2024-05-13 21:14:38 +00:00
|
|
|
nix-shell --command 'cd build && ctest -j --output-on-failure'
|