Add GitHub Actions script.

This commit is contained in:
Hans-Kristian Arntzen 2021-03-12 12:51:53 +01:00
parent 60aa24566e
commit 2e000a0be4
2 changed files with 56 additions and 1 deletions

54
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ opened, synchronize, reopened ]
jobs:
build:
name: "Build ${{ matrix.platform }}"
strategy:
matrix:
platform: [windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest]
env:
PARALLEL: -j 2
runs-on: "${{ matrix.platform }}"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Pull glslang / SPIRV-Tools
shell: bash
working-directory: ${{github.workspace}}
run: ./checkout_glslang_spirv_tools.sh
- name: Build glslang / SPIRV-Tools
shell: bash
working-directory: ${{github.workspace}}
run: ./build_glslang_spirv_tools.sh Release
- name: Configure SPIRV-Cross
shell: bash
run: |
mkdir build
cd build
cmake .. -DSPIRV_CROSS_WERROR=ON -DSPIRV_CROSS_MISC_WARNINGS=ON -DSPIRV_CROSS_SHARED=ON -DCMAKE_INSTALL_PREFIX=output -DCMAKE_BUILD_TYPE=Release -DSPIRV_CROSS_ENABLE_TESTS=ON
- name: Build SPIRV-Cross
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake --build . --config Release
cmake --build . --config Release --target install
- name: Test SPIRV-Cross
shell: bash
working-directory: ${{github.workspace}}/build
run: ctest --verbose -C Release

View File

@ -100,10 +100,11 @@ def get_shader_stats(shader):
def print_msl_compiler_version():
try:
subprocess.check_call(['xcrun', '--sdk', 'iphoneos', 'metal', '--version'])
print('...are the Metal compiler characteristics.\n') # display after so xcrun FNF is silent
print('... are the Metal compiler characteristics.\n') # display after so xcrun FNF is silent
except OSError as e:
if (e.errno != errno.ENOENT): # Ignore xcrun not found error
raise
print('Metal SDK is not present.\n')
except subprocess.CalledProcessError:
pass