Skip to content

Parallelize builds

Parallelize builds #33

Workflow file for this run

name: CI Build
# Perform CI builds for pull requests targeting the dev branches.
on: [push, pull_request]
jobs:
linux:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu GCC Release",
os: ubuntu-latest,
artifact: "gfxreconstruct-dev-ubuntu-gcc-release",
type: "release",
build_dir: "build",
cc: "gcc", cxx: "g++"
}
- {
name: "Ubuntu GCC Debug",
os: ubuntu-latest,
artifact: "gfxreconstruct-dev-ubuntu-gcc-debug",
type: "debug",
build_dir: "dbuild",
cc: "gcc", cxx: "g++"
}
steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y libx11-xcb-dev libxcb-keysyms1-dev libwayland-dev libxrandr-dev liblz4-dev libzstd-dev
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.16.3
- name: Run build script
run: |
if [ "${{ matrix.config.type }}" == "release" ]
then
clang-format --version # A check for version 9 should be added.
git fetch origin ${{ github.base_ref }} # Fetch target branch to FETCH_HEAD for code style check.
python3 scripts/build.py --skip-tests --config ${{ matrix.config.type }} --parallel --check-code-style-base FETCH_HEAD
else
python3 scripts/build.py --skip-tests --config ${{ matrix.config.type }} --parallel --skip-check-code-style
fi
- name: Prepare artifacts
run: |
cp LICENSE.txt ${{ matrix.config.build_dir }}/linux/x64/output/bin/
cp LICENSE_ThirdParty.txt ${{ matrix.config.build_dir }}/linux/x64/output/bin/
cp USAGE_desktop_Vulkan.md ${{ matrix.config.build_dir }}/linux/x64/output/bin/
cp layer/vk_layer_settings.txt ${{ matrix.config.build_dir }}/linux/x64/output/bin/
mv ${{ matrix.config.build_dir }}/linux/x64/output/bin gfxreconstruct-dev
mv ${{ matrix.config.build_dir }}/linux/x64/output/lib*/*.so gfxreconstruct-dev/
mv ${{ matrix.config.build_dir }}/linux/x64/output/share/vulkan/explicit_layer.d/*.json gfxreconstruct-dev/
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ./gfxreconstruct-dev
windows:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows MSVC Release",
os: windows-latest,
artifact: "gfxreconstruct-dev-windows-msvc-release",
type: "release",
build_dir: "build",
cc: "cl", cxx: "cl"
}
- {
name: "Windows MSVC Debug",
os: windows-latest,
artifact: "gfxreconstruct-dev-windows-msvc-debug",
type: "debug",
build_dir: "dbuild",
cc: "cl", cxx: "cl"
}
steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Run build script
run: |
python scripts\build.py --skip-check-code-style --skip-tests --config ${{ matrix.config.type }}
- name: Prepare artifacts
run: |
copy LICENSE.txt ${{ matrix.config.build_dir }}\windows\x64\output\bin\
copy LICENSE_ThirdParty.txt ${{ matrix.config.build_dir }}\windows\x64\output\bin\
copy USAGE_desktop_D3D12.md ${{ matrix.config.build_dir }}\windows\x64\output\bin\
copy USAGE_desktop_Vulkan.md ${{ matrix.config.build_dir }}\windows\x64\output\bin\
copy layer\vk_layer_settings.txt ${{ matrix.config.build_dir }}\windows\x64\output\bin\
move ${{ matrix.config.build_dir }}\windows\x64\output\bin gfxreconstruct-dev
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: .\gfxreconstruct-dev
macOS:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "macOS Release",
os: macos-latest,
artifact: "gfxreconstruct-dev-macOS-release",
type: "release",
build_dir: "build"
}
- {
name: "macOS Debug",
os: macos-latest,
artifact: "gfxreconstruct-dev-macOS-debug",
type: "debug",
build_dir: "dbuild"
}
steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Unlink conflicting packages
run: brew unlink zstd lz4
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: ~/deps
key: ${{ inputs.os }} deps ${{ hashFiles('.github/workflows/scripts/build-dependencies-macos.sh') }}
- name: Build dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: .github/workflows/scripts/build-dependencies-macos.sh
- name: Run build script
run: |
python3 scripts/build.py --skip-check-code-style --skip-tests --config ${{ matrix.config.type }} --parallel --cmake-extra "CMAKE_PREFIX_PATH=$HOME/deps" --cmake-extra CMAKE_OSX_DEPLOYMENT_TARGET=10.13
- name: Prepare artifacts
run: |
cp LICENSE.txt ${{ matrix.config.build_dir }}/darwin/universal/output/bin/
cp LICENSE_ThirdParty.txt ${{ matrix.config.build_dir }}/darwin/universal/output/bin/
cp USAGE_desktop_Vulkan.md ${{ matrix.config.build_dir }}/darwin/universal/output/bin/
cp layer/vk_layer_settings.txt ${{ matrix.config.build_dir }}/darwin/universal/output/bin/
mv ${{ matrix.config.build_dir }}/darwin/universal/output/bin gfxreconstruct-dev
mv ${{ matrix.config.build_dir }}/darwin/universal/output/lib*/*.dylib gfxreconstruct-dev/
mv ${{ matrix.config.build_dir }}/darwin/universal/output/share/vulkan/explicit_layer.d/*.json gfxreconstruct-dev/
# GitHub's artifact uploader doesn't preserve permissions, so zip everything ourselves
# This will result in a zip in a zip, but Finder's unzip will conveniently unzip both at once, so it's not too bad
cd gfxreconstruct-dev
zip -r9 "../${{ matrix.config.artifact }}.zip" *
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ${{ matrix.config.artifact }}.zip
android:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Android Release/Debug",
os: ubuntu-latest,
artifact: "gfxreconstruct-dev-android"
}
steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Update submodules
run: |
git submodule update --init
- name: Gradle build
run: |
cd android
sh gradlew assembleRelease assembleDebug
- name: Prepare artifacts
run: |
mkdir gfxreconstruct-dev
mkdir gfxreconstruct-dev/layer
mkdir gfxreconstruct-dev/tools
cp LICENSE.txt gfxreconstruct-dev/
cp LICENSE_ThirdParty.txt gfxreconstruct-dev/
cp USAGE_android.md gfxreconstruct-dev/
cp layer/vk_layer_settings.txt gfxreconstruct-dev/
cp -r android/layer/build/intermediates/cmake/release/obj/arm64-v8a gfxreconstruct-dev/layer/
cp -r android/layer/build/intermediates/cmake/release/obj/armeabi-v7a gfxreconstruct-dev/layer/
cp android/tools/replay/build/outputs/apk/debug/replay-debug.apk gfxreconstruct-dev/tools/
cp android/scripts/gfxrecon.py gfxreconstruct-dev/tools/
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ./gfxreconstruct-dev