mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
115 lines
3.4 KiB
YAML
115 lines
3.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
pull_request:
|
|
branches:
|
|
- "**"
|
|
types: [opened, synchronize, reopened]
|
|
workflow_dispatch:
|
|
|
|
#concurrency:
|
|
# group: ${{ github.ref }}
|
|
# cancel-in-progress: true
|
|
|
|
jobs:
|
|
dump-registry:
|
|
name: Dump Registry
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Dump Registry
|
|
run: src/grab-registry.bat
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Registry Dump [Temp]
|
|
path: |
|
|
registry/*
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ${{ matrix.runner }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform:
|
|
- Windows
|
|
- Linux GCC
|
|
- Linux Clang
|
|
- macOS
|
|
configuration:
|
|
- Debug
|
|
- Release
|
|
include:
|
|
- configuration: Debug
|
|
preset: debug
|
|
- configuration: Release
|
|
preset: release
|
|
- platform: Windows
|
|
runner: windows-latest
|
|
- platform: Linux GCC
|
|
runner: ubuntu-24.04
|
|
- platform: Linux Clang
|
|
runner: ubuntu-24.04
|
|
clang-version: 18
|
|
- platform: macOS
|
|
runner: macos-latest
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Ninja
|
|
uses: seanmiddleditch/gha-setup-ninja@v5
|
|
|
|
- name: Install Clang
|
|
if: "${{ matrix.platform == 'Linux Clang' }}"
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y wget gnupg software-properties-common
|
|
wget https://apt.llvm.org/llvm-snapshot.gpg.key -O- | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
|
|
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc)-${{ matrix.clang-version }} main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
|
sudo apt update
|
|
sudo apt install -y clang-${{ matrix.clang-version }} lld-${{ matrix.clang-version }}
|
|
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${{ matrix.clang-version }} 100
|
|
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${{ matrix.clang-version }} 100
|
|
sudo update-alternatives --set cc /usr/bin/clang-${{ matrix.clang-version }}
|
|
sudo update-alternatives --set c++ /usr/bin/clang++-${{ matrix.clang-version }}
|
|
|
|
- name: Enable Developer Command Prompt
|
|
uses: ilammy/msvc-dev-cmd@v1.13.0
|
|
if: "${{ matrix.platform == 'Windows' }}"
|
|
|
|
- name: CMake Build
|
|
run: cmake --workflow --preset=${{matrix.preset}}
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.platform }} ${{matrix.configuration}} Artifacts
|
|
path: |
|
|
build/${{matrix.preset}}/artifacts/*
|
|
|
|
- name: Upload Test Configuration
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.platform }} ${{matrix.configuration}} Test Config [Temp]
|
|
path: |
|
|
build/${{matrix.preset}}/**/CTestTestfile.cmake
|
|
cleanup:
|
|
name: Cleanup Artifacts
|
|
runs-on: ubuntu-latest
|
|
needs: [dump-registry, build]
|
|
if: always()
|
|
steps:
|
|
- uses: geekyeggo/delete-artifact@v5
|
|
with:
|
|
name: '*[Temp]'
|