mirror of
https://github.com/xqemu/xqemu.git
synced 2025-04-02 11:11:56 -04:00
58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
name: Build (Windows)
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
Windows:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
configuration: ["Debug", "Release"]
|
|
steps:
|
|
- name: Define Build Options
|
|
shell: python
|
|
run: |
|
|
if "${{ matrix.configuration }}" == "Debug":
|
|
print('Configuring for Debug')
|
|
print('::set-env name=BUILD_PARAM::')
|
|
print('::set-env name=ARTIFACT_NAME::xqemu-debug')
|
|
else:
|
|
print('Configuring for Release')
|
|
print('::set-env name=BUILD_PARAM::--release')
|
|
print('::set-env name=ARTIFACT_NAME::xqemu-release')
|
|
- name: Clone Tree
|
|
uses: actions/checkout@v1
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Install Dependencies
|
|
run: |
|
|
echo "Downloading MSYS2 environment..."
|
|
Invoke-WebRequest -Uri "https://github.com/xqemu/ci-environment-msys2/releases/latest/download/msys64.7z" -OutFile "msys64.7z"
|
|
echo "Extracting MSYS2 environment..."
|
|
7z x -y msys64.7z "-oC:\tools\"
|
|
echo "Updating MSYS2 environment..."
|
|
C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Syu --noconfirm"
|
|
- name: Initialize Compiler Cache
|
|
id: cache
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: C:\tools\msys64\tmp\xqemu-ccache
|
|
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
|
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
|
- name: Compile
|
|
run: |
|
|
C:\tools\msys64\usr\bin\bash.exe -lc @"
|
|
set -e
|
|
cd `$GITHUB_WORKSPACE
|
|
export CCACHE_DIR=/tmp/xqemu-ccache
|
|
export CCACHE_MAXSIZE=250M
|
|
export PATH="/usr/lib/ccache/bin:/mingw64/bin:`$PATH"
|
|
./build.sh ${{ env.BUILD_PARAM }}
|
|
echo -e '\nCompiler Cache Stats:'
|
|
ccache -s -c
|
|
"@
|
|
- name: Upload Build Artifact
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
name: ${{env.ARTIFACT_NAME}}
|
|
path: dist
|