From 09851a7211c16f1099902cae28cbade5093bc126 Mon Sep 17 00:00:00 2001 From: Andrei Holub Date: Sat, 7 Feb 2026 16:11:15 -0500 Subject: [PATCH] Janko: cache on --- .github/workflows/ci-macos.yml | 24 +++++++++++++++++--- .github/workflows/ci-windows.yml | 39 +++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index a01d4dd1f..5118639ed 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -24,23 +24,41 @@ permissions: jobs: build-macos: runs-on: macOS-latest + permissions: + actions: write steps: - uses: actions/checkout@main with: fetch-depth: 0 - name: Install dependencies - run: brew install python3 sdl3 + run: brew install sdl3 + - name: Setup ccache + uses: Chocobo1/setup-ccache-action@v1.5.2 + - 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: | + cd build/generated/mame/layout && touch *.lh - name: Build env: USE_LIBSDL: 1 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 + DEBUG: 0 run: make -j2 - uses: actions/upload-artifact@main with: name: mame-macos-${{ github.sha }} path: | mame - chdman - unidasm if-no-files-found: error diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index eff83eba9..32325f1a1 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -17,6 +17,7 @@ on: - 'src/**' - 'COPYING' - 'makefile' + workflow_dispatch: permissions: contents: read @@ -25,6 +26,7 @@ jobs: build-windows: strategy: matrix: + # compiler: [gcc-x64, clang-x64, clang-arm64] compiler: [gcc-x64] include: - compiler: gcc-x64 @@ -36,6 +38,12 @@ jobs: 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} @@ -43,10 +51,29 @@ jobs: - 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.extrapkg }} + 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" @@ -56,12 +83,18 @@ jobs: 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 - chdman.exe - unidasm.exe if-no-files-found: error