mirror of
https://github.com/open-simh/simh.git
synced 2026-05-20 12:52:00 +00:00
- macos-13: Deprecated and gone. - checkout, upload-artifact: Github action script version changes. - windows-latest (aka windows-2025): Leave future TODO notes in cmake-builds.yml. It's pointless to build on windows-2025 since there is no newer Visual Studio version than VS 2022 and doing so will produce the exact same package outputs.
254 lines
9.5 KiB
YAML
254 lines
9.5 KiB
YAML
name: CMake build workflows
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
cmake-unix:
|
|
name: Ubuntu
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
#-
|
|
# The CMake builds produce artifacts (*) and the runner image's name is
|
|
# used in the artifact's name, simh-4.1.0-x86_64-ubuntu-20.04.deb.
|
|
# Consequently, each runner image is enumerated for each artifact (*)
|
|
# that the build produces.
|
|
#
|
|
# (*) "artefact" for the rest of the Anglosphere
|
|
#-
|
|
matrix:
|
|
os: [ubuntu-22.04, ubuntu-latest]
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Install dependencies
|
|
run: |
|
|
sh -ex .travis/deps.sh linux
|
|
sudo apt install -ym ninja-build
|
|
- name: cmake-builder.sh
|
|
run: |
|
|
cmake/cmake-builder.sh --config Release --flavor ninja --lto --notest --parallel --verbose --cpack_suffix x86_64-${{matrix.os}}
|
|
- name: SIMH simulator suite test
|
|
run: |
|
|
cmake/cmake-builder.sh --config Release --flavor ninja --testonly
|
|
## Install isn't strictly necessary, but it's a good way to see what dependencies
|
|
## (IMPORTED_RUNTIME_ARTIFACTS) get installed.
|
|
- name: Install
|
|
run: |
|
|
cmake/cmake-builder.sh --config Release --flavor ninja --installonly
|
|
- name: SIMH packaging
|
|
run: |
|
|
cd cmake/build-ninja
|
|
cpack -G DEB -C Release
|
|
- name: Upload DEB
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: simh-4.1.0-x86_64-${{matrix.os}}.deb
|
|
path: cmake/build-ninja/simh-4.1.0-x86_64-${{matrix.os}}.deb
|
|
|
|
|
|
cmake-macOS:
|
|
name: macOS
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
#-
|
|
# The CMake builds produce artifacts (*) and the runner image's name is
|
|
# used in the artifact's name, e.g., simh-4.1.0-m1.macos-14.dmg.
|
|
# Consequently, each runner image is enumerated for each artifact (*)
|
|
# that the build produces.
|
|
#
|
|
# (*) "artefact" for the rest of the Anglosphere -
|
|
#
|
|
# As of 18 NOV 2024, Github deprecated macos-12.
|
|
matrix:
|
|
os: [macos-14, macos-latest]
|
|
|
|
env:
|
|
CPACK_SUFFIX: ${{matrix.os != 'macos-14' && 'x86_64' || 'm1'}}.${{matrix.os}}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
## Nuke homebrew and start with a clean instance.
|
|
- name: Reinstall HomeBrew (macOS)
|
|
run: |
|
|
/usr/bin/sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
|
|
[ -d /opt/homebrew ] && ( sudo rm -rf /opt/homebrew/* || true )
|
|
[ -d /usr/local ] && ( sudo rm -rf /usr/local/* || true )
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sh -ex .travis/deps.sh osx
|
|
|
|
- name: cmake-builder.sh
|
|
run: |
|
|
cmake/cmake-builder.sh --config Release --flavor xcode --notest --cpack_suffix ${{env.CPACK_SUFFIX}}
|
|
|
|
- name: SIMH simulator suite test
|
|
run: |
|
|
cmake/cmake-builder.sh --config Release --flavor xcode --testonly
|
|
|
|
## Install isn't strictly necessary, but it's a good way to see what dependencies
|
|
## (IMPORTED_RUNTIME_ARTIFACTS) get installed.
|
|
|
|
- name: Install
|
|
run: |
|
|
cmake/cmake-builder.sh --config Release --flavor xcode --installonly
|
|
|
|
- name: SIMH packaging
|
|
run: |
|
|
cd cmake/build-xcode
|
|
cpack -G "ZIP;TGZ" -C Release
|
|
cpack -G DragNDrop -C Release
|
|
|
|
- name: Upload ZIP
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: simh-4.1.0-${{env.CPACK_SUFFIX}}.zip
|
|
path: cmake/build-xcode/simh-4.1.0-${{env.CPACK_SUFFIX}}.zip
|
|
|
|
- name: Upload DMG
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: simh-4.1.0-${{env.CPACK_SUFFIX}}.dmg
|
|
path: cmake/build-xcode/simh-4.1.0-${{env.CPACK_SUFFIX}}.dmg
|
|
|
|
|
|
cmake-vs2022xp:
|
|
name: LEGACY XP executables
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Install v141_xp (XP toolkit) and build SIMH
|
|
shell: pwsh
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
$WarningPreference = "Continue"
|
|
$DebugPreference = "Continue"
|
|
|
|
# Fix PATH so that "C:\Strawberry" (Strawberry Perl) doesn't mess with the build
|
|
# CMake WILL find incompatible libraries within Strawberry.
|
|
$fixPATH = (${env:PATH}.Split(';') | `
|
|
Where-Object { $_ -notlike "*\Strawberry\*" -and $_ -notlike "*/Strawberry/*" }) -join ';'
|
|
$env:Path = $fixPATH
|
|
|
|
## Install the XP toolkit, aka v141_xp. This script is specific to the Github environment.
|
|
./cmake/github_v141_xp.ps1
|
|
|
|
#+
|
|
# The GH Windows runner image documentation says that the VSSetup module is installed, from
|
|
# whence Get-VSSetupInstance and Select-VSSetupInstance are imported. This step is pure
|
|
# paranoia, ensuring that we really, truly and honestly have WinXP support.
|
|
#-
|
|
Write-Debug "Get-VSSetupInstance/Select-VSSetupInstance"
|
|
$instances=$(Get-VSSetupInstance -All | Select-VSSetupInstance -Require 'Microsoft.VisualStudio.Component.WinXP' -Latest)
|
|
if ($null -eq $instances)
|
|
{
|
|
throw "v141_xp didn't install correctly or incomplete install."
|
|
}
|
|
else
|
|
{
|
|
$instances | Write-Output
|
|
}
|
|
|
|
## Don't use LTO for XP. XP compatibility comes from VS2017 -- MS is
|
|
## at VS2022. There are likely legacy bugs that have been fixed.
|
|
./cmake/cmake-builder.ps1 -flavor vs2022-xp -config Release -clean -verbose -notest -cpack_suffix win32-xp
|
|
|
|
|
|
- name: SIMH simulator suite test
|
|
shell: pwsh
|
|
run: |
|
|
./cmake/cmake-builder.ps1 -flavor vs2022-xp -config Release -testOnly
|
|
## Install isn't strictly necessary, but it's a good way to see what dependencies
|
|
## (IMPORTED_RUNTIME_ARTIFACTS) get installed.
|
|
- name: Install
|
|
shell: pwsh
|
|
run: |
|
|
cmake/cmake-builder.ps1 -config Release -flavor vs2022-xp -installOnly
|
|
- name: SIMH packaging
|
|
shell: pwsh
|
|
run: |
|
|
cd cmake\build-vs2022-xp
|
|
cpack -G "ZIP;WIX" -C Release
|
|
- name: Upload ZIP
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: simh-4.1.0-win32-vs2022xp.zip
|
|
path: cmake/build-vs2022-xp/simh-4.1.0-win32-xp.zip
|
|
- name: Upload MSI
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: simh-4.1.0-win32-vs2022xp.msi
|
|
path: cmake/build-vs2022-xp/simh-4.1.0-win32-xp.msi
|
|
|
|
## Visual Studio: The open-simh CMake workflow does not make use of windows-latest (aka windows-2025).
|
|
##
|
|
## There is only Visual Studio 2022, so it's pointless to build on both Windows 2022 and Windows 2025
|
|
## to produce identical artifacts/artefacts.
|
|
##
|
|
## TODO: When there is a new Visual Studio release, update matrix.os, remove matrix.build. Use the
|
|
## ${{ fromJSON ... }} hack to look up the cmake-builder.ps1 flavor corresponding to the Visual
|
|
## Studio installation.
|
|
##
|
|
## TODO: windows-2025 does not have NSIS, so will have to conditionalize the NSIS installer and
|
|
## EXE package upload, e.g., if: ${{ matrix.os == "windows-2022" }}
|
|
|
|
cmake-vstudio:
|
|
name: Visual Studio w/VCPKG executables
|
|
runs-on: ${{matrix.os}}
|
|
strategy:
|
|
matrix:
|
|
os: [windows-2022]
|
|
build: [vs2022]
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: ${{ matrix.build }} build
|
|
shell: pwsh
|
|
run: |
|
|
$ErrorActionPreference="Stop"
|
|
$WarningPreference="Continue"
|
|
# Fix PATH so that "C:\Strawberry" (Strawberry Perl) doesn't mess with the build
|
|
# CMake WILL find incompatible libraries within Strawberry.
|
|
$fixPATH = (${env:PATH}.Split(';') | `
|
|
Where-Object { $_ -notlike "*\Strawberry\*" -and $_ -notlike "*/Strawberry/*" }) -join ';'
|
|
$env:PATH = $fixPATH
|
|
# Make this a vcpkg build:
|
|
$env:VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT
|
|
Push-Location $env:VCPKG_ROOT
|
|
git pull
|
|
Pop-Location
|
|
./cmake/cmake-builder.ps1 -flavor ${{matrix.build}} -config Release -clean -lto -verbose `
|
|
-notest `
|
|
-cpack_suffix ${{matrix.build}}
|
|
- name: SIMH simulator suite test
|
|
shell: pwsh
|
|
run: |
|
|
./cmake/cmake-builder.ps1 -flavor ${{matrix.build}} -config Release -testOnly
|
|
## Install isn't strictly necessary, but it's a good way to see what dependencies
|
|
## (IMPORTED_RUNTIME_ARTIFACTS) get installed.
|
|
- name: Install
|
|
shell: pwsh
|
|
run: |
|
|
cmake/cmake-builder.ps1 -config Release -flavor ${{matrix.build}} -installOnly
|
|
- name: SIMH packaging
|
|
shell: pwsh
|
|
run: |
|
|
cd cmake\build-${{matrix.build}}
|
|
cpack -G "NSIS;WIX;ZIP" -C Release
|
|
- name: Upload EXE installer
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: simh-4.1.0-${{matrix.build}}.exe
|
|
path: cmake/build-${{matrix.build}}/simh-4.1.0-${{matrix.build}}.exe
|
|
- name: Upload ZIP
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: simh-4.1.0-${{matrix.build}}.zip
|
|
path: cmake/build-${{matrix.build}}/simh-4.1.0-${{matrix.build}}.zip
|
|
- name: Upload MSI installer
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: simh-4.1.0-${{matrix.build}}.msi
|
|
path: cmake/build-${{matrix.build}}/simh-4.1.0-${{matrix.build}}.msi
|