Skip to content

Commit

Permalink
Add Github Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchieMeng committed Apr 4, 2021
1 parent 5dcb238 commit 8fee1b6
Show file tree
Hide file tree
Showing 2 changed files with 419 additions and 0 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: CI
on: [push, pull_request]
env:
DEVELOPER_DIR: /Applications/Xcode_12.2.app/Contents/Developer
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "VulkanSDK"
key: VulkanSDK-1.2.162.0-Installer
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/1.2.162.0/windows/VulkanSDK-1.2.162.0-Installer.exe?Human=true -OutFile VulkanSDK-1.2.162.0-Installer.exe
7z x -aoa ./VulkanSDK-1.2.162.0-Installer.exe -oVulkanSDK
Remove-Item .\VulkanSDK\Demos, .\VulkanSDK\Samples, .\VulkanSDK\Third-Party, .\VulkanSDK\Tools, .\VulkanSDK\Tools32, .\VulkanSDK\Bin32, .\VulkanSDK\Lib32 -Recurse
- name: cache-swig
id: cache-swig
uses: actions/cache@v1
with:
path: "SWIG"
key: swigwin-4.0.2
- name: swig
if: steps.cache-swig.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://nchc.dl.sourceforge.net/project/swig/swigwin/swigwin-4.0.2/swigwin-4.0.2.zip -OutFile swigwin-4.0.2.zip
7z x swigwin-4.0.2.zip
mv swigwin-4.0.2 SWIG
- name: build
run: |
$env:VULKAN_SDK="$(pwd)\VulkanSDK"
$env:SWIG_DIR="$(pwd)\SWIG"
$env:SWIG_EXECUTABLE="$(pwd)\SWIG\swig.exe"
$env:PATH="$env:PATH;$env:SWIG_DIR"
mkdir build; cd build
cmake -A x64 ../src
cmake --build . --config Release -j 2
ubuntu: # no needs to install swig for it is already there
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "1.2.162.0"
key: vulkansdk-linux-x86_64-1.2.162.0
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.2.162.0/linux/vulkansdk-linux-x86_64-1.2.162.0.tar.gz?Human=true -O vulkansdk-linux-x86_64-1.2.162.0.tar.gz
tar -xf vulkansdk-linux-x86_64-1.2.162.0.tar.gz
rm -rf 1.2.162.0/source 1.2.162.0/samples
find 1.2.162.0 -type f | grep -v -E 'vulkan|glslang' | xargs rm
- name: build
run: |
export VULKAN_SDK=`pwd`/1.2.162.0/x86_64
mkdir build && cd build
cmake ../src
cmake --build . -j 2
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: cache-vulkansdk
id: cache-vulkansdk
uses: actions/cache@v1
with:
path: "vulkansdk-macos-1.2.162.0"
key: vulkansdk-macos-1.2.162.0
- name: vulkansdk
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: |
wget https://sdk.lunarg.com/sdk/download/1.2.162.0/mac/vulkansdk-macos-1.2.162.0.dmg?Human=true -O vulkansdk-macos-1.2.162.0.dmg
hdiutil attach vulkansdk-macos-1.2.162.0.dmg
cp -r /Volumes/vulkansdk-macos-1.2.162.0 .
rm -rf vulkansdk-macos-1.2.162.0/Applications
find vulkansdk-macos-1.2.162.0 -type f | grep -v -E 'vulkan|glslang|MoltenVK' | xargs rm
hdiutil detach /Volumes/vulkansdk-macos-1.2.162.0
- name: install-swig
run: brew install swig
- name: build-x86_64
run: |
export VULKAN_SDK=`pwd`/vulkansdk-macos-1.2.162.0/macOS
mkdir build-x86_64 && cd build-x86_64
cmake -DUSE_STATIC_MOLTENVK=ON -DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DVulkan_INCLUDE_DIR=`pwd`/../vulkansdk-macos-1.2.162.0/MoltenVK/include \
-DVulkan_LIBRARY=`pwd`/../vulkansdk-macos-1.2.162.0/MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a \
../src
cmake --build . -j 3
# - name: build-arm64
# run: |
# export VULKAN_SDK=`pwd`/vulkansdk-macos-1.2.162.0/macOS
# mkdir build-arm64 && cd build-arm64
# cmake -DUSE_STATIC_MOLTENVK=ON -DCMAKE_OSX_ARCHITECTURES="arm64" \
# -DVulkan_INCLUDE_DIR=`pwd`/../vulkansdk-macos-1.2.162.0/MoltenVK/include \
# -DVulkan_LIBRARY=`pwd`/../vulkansdk-macos-1.2.162.0/MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a \
# ../src
# cmake --build . -j 3
Loading

0 comments on commit 8fee1b6

Please sign in to comment.