Skip to content

Build Swiftshader

Build Swiftshader #11

name: Build Swiftshader
on: [workflow_dispatch]
jobs:
build:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest, windows-2019]
steps:
- name: Setup Ninja
uses: ./.github/actions/setup-ninja
- name: Fetch sources
run: |
git clone -b master --depth 1 https://github.com/google/swiftshader.git swiftshader
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
variant: sccache
key: ${{ matrix.os }}-swiftshader
- name: Configure
shell: bash
run: |
mkdir build
cd build
cmake ../swiftshader -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_BUILD_TYPE=Release \
-DSWIFTSHADER_WARNINGS_AS_ERRORS=OFF \
-DSWIFTSHADER_BUILD_TESTS=OFF \
-DSWIFTSHADER_BUILD_PVR=OFF
- name: Build
run: |
cmake --build ./build --config Release -j3
ls ./build
- name: Compose artifact path
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
echo "artifact-dir=Windows" >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "artifact-dir=Darwin" >> $GITHUB_ENV
else
echo "artifact-dir=Linux" >> $GITHUB_ENV
fi
- uses: actions/upload-artifact@v3
with:
name: swiftshader-${{ runner.os }}
path: ./build/${{ env.artifact-dir }}