CI #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
# Run on the 2nd of every month, at 10AM UTC | |
schedule: | |
- cron: '0 10 2 * *' | |
# Run the workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
env: | |
PREMAKE_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2 | |
VULKAN_URL: https://sdk.lunarg.com/sdk/download | |
VULKAN_VERSION: "1.3.250.1" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
premake-opts: gmake2 | |
- os: windows-2019 | |
premake-opts: vs2019 | |
- os: macos-11 | |
premake-opts: gmake2 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clone code repository | |
uses: actions/checkout@v2 | |
- name: Dependencies for Ubuntu | |
if: startsWith(matrix.os, 'ubuntu') | |
shell: bash | |
working-directory: ${{github.workspace}} | |
run: | | |
sudo apt-get update -y && sudo apt-get install -yq xorg-dev libgtk-3-dev | |
wget -O premake.tar.gz ${PREMAKE_URL}-linux.tar.gz | |
tar -xzf premake.tar.gz | |
- name: Dependencies for macOS | |
if: startsWith(matrix.os, 'macos') | |
shell: bash | |
working-directory: ${{github.workspace}} | |
run: | | |
brew install wget | |
wget -O premake.tar.gz ${PREMAKE_URL}-macosx.tar.gz | |
tar -xzf premake.tar.gz | |
- name: Dependencies for Windows | |
if: startsWith(matrix.os, 'windows') | |
shell: bash | |
working-directory: ${{github.workspace}} | |
run: | | |
choco install wget | |
wget -O premake.zip ${PREMAKE_URL}-windows.zip | |
7z e premake.zip | |
- name: Cache Vulkan | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{github.workspace}}/vulkansdk | |
key: ${{ runner.os }}-vulkansdk-${{ env.VULKAN_VERSION }} | |
- name: Vulkan for Ubuntu | |
if: startsWith(matrix.os, 'ubuntu') && (steps.cache.outputs.cache-hit != 'true') | |
shell: bash | |
working-directory: ${{github.workspace}} | |
run: | | |
wget -O vulkansdk.tar.gz ${VULKAN_URL}/${VULKAN_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_VERSION}.tar.gz | |
mkdir vulkansdk && tar -xf vulkansdk.tar.gz -C vulkansdk --strip-components=1 | |
- name: Vulkan for macOS | |
if: startsWith(matrix.os, 'macos') && (steps.cache.outputs.cache-hit != 'true') | |
shell: bash | |
working-directory: ${{github.workspace}} | |
run: | | |
wget -O vulkansdk.dmg ${VULKAN_URL}/${VULKAN_VERSION}/mac/vulkansdk-macos-${VULKAN_VERSION}.dmg | |
hdiutil attach vulkansdk.dmg | |
/Volumes/VulkanSDK/InstallVulkan.app/Contents/MacOS/InstallVulkan --root `pwd`/vulkansdk/ --accept-licenses --default-answer --confirm-command install copy_only=1 | |
hdiutil detach /Volumes/VulkanSDK | |
mv vulkansdk/macOS vulkansdk/x86_64 | |
- name: Vulkan for Windows | |
if: startsWith(matrix.os, 'windows') && (steps.cache.outputs.cache-hit != 'true') | |
shell: bash | |
working-directory: ${{github.workspace}} | |
run: | | |
wget -O vulkansdk.exe ${VULKAN_URL}/${VULKAN_VERSION}/windows/VulkanSDK-${VULKAN_VERSION}-Installer.exe | |
7z x -aoa ./vulkansdk.exe -ovulkansdk | |
- name: Generate projects | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: | | |
./premake5 ${{matrix.premake-opts}} --skip_shader_validation --env_vulkan_sdk | |
- name: Build using Make | |
if: ${{matrix.premake-opts == 'gmake2' }} | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: | | |
export VULKAN_SDK=`pwd`/vulkansdk/x86_64 | |
cd build | |
make ALL | |
- name: Build using MSVC | |
if: ${{matrix.premake-opts == 'vs2019' }} | |
working-directory: ${{github.workspace}} | |
shell: cmd | |
run: | | |
set VULKAN_SDK=%cd%\vulkansdk | |
cd build | |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" .\Rendu.sln -t:Meta\ALL -nologo -v:minimal -p:Configuration=Release -p:Platform=x64 | |
- name: Upload shader validator | |
if: ${{ success() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: shader-validator-${{matrix.os}} | |
path: | | |
${{ github.workspace }}/build/ShaderValidator/Release/ShaderValidator.exe | |
${{ github.workspace }}/build/ShaderValidator/Release/ShaderValidator | |
retention-days: 1 | |
validate_shaders: | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
premake-opts: gmake2 | |
- os: windows-2019 | |
premake-opts: vs2019 | |
- os: macos-11 | |
premake-opts: gmake2 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clone code repository | |
uses: actions/checkout@v2 | |
- name: Download shader validator | |
uses: actions/download-artifact@v2 | |
with: | |
name: shader-validator-${{matrix.os}} | |
- name: Compile all shaders | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: | | |
chmod +x ShaderValidator | |
./ShaderValidator ./resources/ |