Dawn update #297
Workflow file for this run
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: Swatinem/rust-cache@v1 | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
- uses: pietrobolcato/action-read-yaml@1.1.0 | |
id: read_versions | |
with: | |
config: ${{ github.workspace }}/.github/dependency_versions.yaml | |
- name: Download dawn libs | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
shell: bash | |
run: | | |
release_tag="${{ steps.read_versions.outputs['dawn'] }}" | |
gh release download $release_tag -p dawn-static-linux64.tar.gz -R wgslsmith/dawn-build | |
mkdir dawn-static-linux64 | |
tar -xvf dawn-static-linux64.tar.gz | |
echo "DAWN_BUILD_DIR=${{ github.workspace }}/dawn-static-linux64" >> $GITHUB_ENV | |
- name: Run clippy | |
run: cargo clippy --workspace --all-features -- -Dwarnings | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: Swatinem/rust-cache@v1 | |
- uses: pietrobolcato/action-read-yaml@1.1.0 | |
id: read_versions | |
with: | |
config: ${{ github.workspace }}/.github/dependency_versions.yaml | |
- name: Download dawn libs | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
shell: bash | |
run: | | |
release_tag="${{ steps.read_versions.outputs['dawn'] }}" | |
gh release download $release_tag -p dawn-static-linux64.tar.gz -R wgslsmith/dawn-build | |
mkdir dawn-static-linux64 | |
tar -xvf dawn-static-linux64.tar.gz | |
echo "DAWN_BUILD_DIR=${{ github.workspace }}/dawn-static-linux64" >> $GITHUB_ENV | |
- name: Run tests | |
run: cargo test --workspace --all-features | |
build_harness: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
target: | |
- win64 | |
- macos64 | |
- linux64 | |
include: | |
- target: win64 | |
os: ubuntu-latest | |
rust-target: x86_64-pc-windows-msvc | |
exe_suffix: .exe | |
- target: macos64 | |
os: macos-latest | |
rust-target: x86_64-apple-darwin | |
exe_suffix: "" | |
- target: linux64 | |
os: ubuntu-latest | |
rust-target: x86_64-unknown-linux-gnu | |
exe_suffix: "" | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.rust-target }} | |
override: true | |
- name: Cache windows sdk | |
id: cache-windows-sdk | |
if: matrix.target == 'win64' | |
uses: actions/cache@v3 | |
with: | |
path: .xwin-cache | |
key: xwin-cache | |
- name: Download windows sdk | |
if: matrix.target == 'win64' && steps.cache-windows-sdk.outputs.cache-hit != 'true' | |
run: | | |
curl -L https://github.com/Jake-Shadle/xwin/releases/download/0.2.0/xwin-0.2.0-x86_64-unknown-linux-musl.tar.gz > $HOME/xwin.tar.gz | |
tar -xvf $HOME/xwin.tar.gz -C $HOME | |
sudo mv $HOME/xwin-0.2.0-x86_64-unknown-linux-musl/xwin /usr/bin | |
xwin --accept-license splat --include-debug-libs | |
- name: Install windows dependencies | |
if: matrix.target == 'win64' | |
run: | | |
sudo apt-get update | |
sudo apt-get install clang-12 clang-tools-12 llvm-12 lld-12 | |
- uses: pietrobolcato/action-read-yaml@1.1.0 | |
id: read_versions | |
with: | |
config: ${{ github.workspace }}/.github/dependency_versions.yaml | |
- name: Download dawn libs | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
shell: bash | |
run: | | |
release_tag="${{ steps.read_versions.outputs['dawn'] }}" | |
gh release download $release_tag -p dawn-static-${{ matrix.target }}.tar.gz -R wgslsmith/dawn-build | |
mkdir dawn-static-${{ matrix.target }} | |
tar -xvf dawn-static-${{ matrix.target }}.tar.gz | |
- name: Build harness | |
uses: actions-rs/cargo@v1 | |
env: | |
DAWN_BUILD_DIR: ${{ github.workspace }}/dawn-static-${{ matrix.target }} | |
CARGO_BUILD_TARGET: ${{ matrix.rust-target }} | |
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS: >- | |
-C linker=lld-link-12 | |
-Lnative=${{ github.workspace }}/.xwin-cache/splat/crt/lib/x86_64 | |
-Lnative=${{ github.workspace }}/.xwin-cache/splat/sdk/lib/ucrt/x86_64 | |
-Lnative=${{ github.workspace }}/.xwin-cache/splat/sdk/lib/um/x86_64 | |
CXX_x86_64_pc_windows_msvc: clang-cl-12 | |
CXXFLAGS_x86_64_pc_windows_msvc: >- | |
/imsvc ${{ github.workspace }}/.xwin-cache/splat/crt/include | |
/imsvc ${{ github.workspace }}/.xwin-cache/splat/sdk/include/ucrt | |
AR_x86_64_pc_windows_msvc: llvm-lib-12 | |
MACOSX_DEPLOYMENT_TARGET: "11.0" | |
with: | |
command: build | |
args: -p harness --release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: harness-${{ matrix.target }} | |
path: target/${{ matrix.rust-target }}/release/wgslsmith-harness${{ matrix.exe_suffix }} | |
test_harness: | |
runs-on: ${{ matrix.os }} | |
needs: build_harness | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- windows-latest | |
- ubuntu-latest | |
include: | |
- os: windows-latest | |
artifact: win64 | |
- os: ubuntu-latest | |
artifact: linux64 | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Download swiftshader | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: | | |
release_tag=`gh release view --json tagName -q '.tagName' -R wgslsmith/swiftshader-build` | |
gh release download $release_tag -p swiftshader-${{ matrix.artifact }}.tar.gz -R wgslsmith/swiftshader-build | |
mkdir swiftshader-${{ matrix.artifact }} | |
tar -xvf swiftshader-${{ matrix.artifact }}.tar.gz | |
- name: Download harness | |
uses: actions/download-artifact@v3 | |
with: | |
name: harness-${{ matrix.artifact }} | |
path: harness-${{ matrix.artifact }} | |
- name: Copy vulkan loader | |
if: matrix.os == 'windows-latest' | |
run: cp swiftshader-${{ matrix.artifact }}/vulkan-1.dll . | |
- name: Run test shaders | |
env: | |
VK_ICD_FILENAMES: swiftshader-${{ matrix.artifact }}/vk_swiftshader_icd.json | |
shell: bash | |
run: | | |
chmod +x ./harness-${{ matrix.artifact }}/wgslsmith-harness | |
./harness-${{ matrix.artifact }}/wgslsmith-harness run crates/harness/test.wgsl crates/harness/test.json |