Skip to content

Build Swiftshader

Build Swiftshader #17

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:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false
- 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/ccache-action@v1.2
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@v4
with:
name: swiftshader-${{ runner.os }}
path: ./build/${{ env.artifact-dir }}