MAME/.github/workflows/ci-windows.yml
2026-05-24 11:55:58 -04:00

101 lines
3.0 KiB
YAML

name: CI (Windows)
on:
push:
paths:
- '.github/workflows/**'
- '3rdparty/**'
- 'scripts/**'
- 'src/**'
- 'COPYING'
- 'makefile'
pull_request:
paths:
- '.github/workflows/**'
- '3rdparty/**'
- 'scripts/**'
- 'src/**'
- 'COPYING'
- 'makefile'
workflow_dispatch:
permissions:
contents: read
jobs:
build-windows:
strategy:
matrix:
# compiler: [gcc-x64, clang-x64, clang-arm64]
compiler: [gcc-x64]
include:
- compiler: gcc-x64
os: windows-latest
msys: UCRT64
slug: mingw-w64-ucrt-x86_64
cc: gcc
cxx: g++
subtarget: mame
executable: mame
runs-on: ${{ matrix.os }}
# write permission needed for setup-ccache-action to remove its stale caches
# see its readme to disable that if no permissions are to be allowed
permissions:
actions: write
env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c # v2.31.1
with:
msystem: ${{ matrix.msys }}
install: git make ${{ matrix.slug }}-${{ matrix.cc }} ${{ matrix.slug }}-python ${{ matrix.slug }}-lld ${{ matrix.slug }}-llvm ${{ matrix.slug }}-libc++ ${{ matrix.slug }}-ccache ${{ matrix.extrapkg }}
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1.5.2
with:
windows_compile_environment: msys2
install_ccache: false
update_packager_index: false
- name: Prepare for complay cache
run: |
grep complay makefile >complay.prehash
cat scripts/build/complay.py >>complay.prehash
- name: cache complay-ed layouts
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/build/generated/mame/layout
key: complay_${{ hashFiles('complay.prehash','**.lay') }}
- name: Touch complay-ed layouts
continue-on-error: true
run: |
[ -d build/generated/mame/layout ] && cd build/generated/mame/layout && touch *.lh
- name: Build
env:
OVERRIDE_AR: "llvm-ar"
OVERRIDE_CC: ${{ matrix.cc }}
OVERRIDE_CXX: ${{ matrix.cxx }}
ARCHOPTS: "-fuse-ld=lld"
SUBTARGET: ${{ matrix.subtarget }}
SOURCES: sinclair/sprinter.cpp,sinclair/evo/tsconf.cpp,sinclair/next/specnext.cpp,sinclair/evo/pentevo.cpp,sinclair/spectrum.cpp,sinclair/spec128.cpp,sinclair/specpls3.cpp,sinclair/scorpion.cpp
TOOLS: 1
REGENIE: 1
PRECOMPILE: 0
run: make -j2
- name: Sneaking
run: |
ls -la
find build
- name: Validate
run: ./${{ matrix.executable }}.exe -validate
- uses: actions/upload-artifact@main
with:
name: ${{ matrix.executable }}-windows-${{ matrix.compiler }}-${{ github.sha }}
path: |
${{ matrix.executable }}.exe
if-no-files-found: error