mirror of https://github.com/xemu-project/xemu.git
ci: Merge build jobs to a single workflow
This commit is contained in:
parent
0ced417e73
commit
4d3555a36c
|
@ -0,0 +1,153 @@
|
|||
name: Build
|
||||
|
||||
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
|
||||
|
||||
Ubuntu:
|
||||
runs-on: ubuntu-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: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
libsdl2-dev \
|
||||
libepoxy-dev \
|
||||
libpixman-1-dev \
|
||||
ccache
|
||||
- name: Initialize Compiler Cache
|
||||
id: cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: /tmp/xqemu-ccache
|
||||
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
||||
- name: Compile
|
||||
run: |
|
||||
export CCACHE_DIR=/tmp/xqemu-ccache
|
||||
export CCACHE_MAXSIZE=250M
|
||||
export PATH="/usr/lib/ccache:$PATH"
|
||||
./build.sh ${{ env.BUILD_PARAM }}
|
||||
echo -e "\nCompiler Cache Stats:"
|
||||
ccache -s -c
|
||||
|
||||
macOS:
|
||||
runs-on: macOS-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: |
|
||||
brew update
|
||||
brew unlink python@2
|
||||
brew install \
|
||||
glib \
|
||||
pixman \
|
||||
sdl2 \
|
||||
libepoxy \
|
||||
coreutils \
|
||||
pkg-config \
|
||||
ccache
|
||||
- name: Initialize Compiler Cache
|
||||
id: cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: /tmp/xqemu-ccache
|
||||
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
||||
- name: Compile
|
||||
run: |
|
||||
export CCACHE_DIR=/tmp/xqemu-ccache
|
||||
export CCACHE_MAXSIZE=250M
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||
./build.sh ${{ env.BUILD_PARAM }}
|
||||
echo -e "\nCompiler Cache Stats:"
|
||||
ccache -s -c
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
name: Build (macOS)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
macOS:
|
||||
runs-on: macOS-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: |
|
||||
brew update
|
||||
brew unlink python@2
|
||||
brew install \
|
||||
glib \
|
||||
pixman \
|
||||
sdl2 \
|
||||
libepoxy \
|
||||
coreutils \
|
||||
pkg-config \
|
||||
ccache
|
||||
- name: Initialize Compiler Cache
|
||||
id: cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: /tmp/xqemu-ccache
|
||||
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
||||
- name: Compile
|
||||
run: |
|
||||
export CCACHE_DIR=/tmp/xqemu-ccache
|
||||
export CCACHE_MAXSIZE=250M
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||
./build.sh ${{ env.BUILD_PARAM }}
|
||||
echo -e "\nCompiler Cache Stats:"
|
||||
ccache -s -c
|
|
@ -1,49 +0,0 @@
|
|||
name: Build (Ubuntu)
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
Ubuntu:
|
||||
runs-on: ubuntu-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: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
libsdl2-dev \
|
||||
libepoxy-dev \
|
||||
libpixman-1-dev \
|
||||
ccache
|
||||
- name: Initialize Compiler Cache
|
||||
id: cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: /tmp/xqemu-ccache
|
||||
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
||||
- name: Compile
|
||||
run: |
|
||||
export CCACHE_DIR=/tmp/xqemu-ccache
|
||||
export CCACHE_MAXSIZE=250M
|
||||
export PATH="/usr/lib/ccache:$PATH"
|
||||
./build.sh ${{ env.BUILD_PARAM }}
|
||||
echo -e "\nCompiler Cache Stats:"
|
||||
ccache -s -c
|
|
@ -1,58 +0,0 @@
|
|||
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
|
Loading…
Reference in New Issue