Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 41 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@ jobs:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
runs-on: ${{ matrix.os }}
env:
RUSTUP_UNPACK_RAM: "26214400"
RUSTUP_IO_THREADS: "1"
steps:
- uses: actions/checkout@v4
- name: Install Vulkan SDK
uses: jakoch/install-vulkan-sdk-action@v1
with:
vulkan_version: 1.4.321.0
install_runtime: true
cache: true
# cache restore on mac is broken
# see https://github.com/jakoch/install-vulkan-sdk-action/issues/558
cache: ${{ runner.os != 'macOS' }}
stripdown: true
- if: ${{ runner.os == 'Linux' }}
name: Linux - Install native dependencies
Expand All @@ -42,6 +41,11 @@ jobs:
# figure out native target triple while we're at it
- name: install rust-toolchain
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
- uses: Swatinem/rust-cache@v2
with:
add-job-id-key: "false"
shared-key: "base"
save-if: ${{ github.ref_name == 'main' }}
# Fetch dependencies in a separate step to clearly show how long each part
# of the testing takes
- name: cargo fetch --locked
Expand All @@ -55,8 +59,8 @@ jobs:
- name: rustc_codegen_spirv test
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"

- name: workspace test (excluding examples & difftest)
run: cargo test --release --workspace --exclude "example-runner-*" --exclude "difftest*" --no-default-features --features "use-installed-tools,clap"
- name: workspace test (excluding examples)
run: cargo test --release --workspace --exclude "example-runner-*" --no-default-features --features "use-installed-tools,clap"

# Examples
- name: cargo check examples
Expand All @@ -77,16 +81,24 @@ jobs:
OUT_DIR: "target/debug/ci/out"
run: cargo run -p example-runner-wgpu-builder --no-default-features --features "use-installed-tools"

# Our test runners select very different features for dependencies, so they need to be two separate builds.
# * compiletests depends on `rustc_codegen_spirv` directly with features `use-installed-tools`
# * difftests depends on `spirv-builder` with no features, which excludes `rustc_codegen_spirv` entirely.
# The individual difftest crates depend on it and run the spirv compile, never the test runner itself.
- name: prep cache for other jobs
if: github.ref_name == 'main'
run: |
cargo build -p compiletests --release --no-default-features --features "use-installed-tools"
cargo build -p difftests --release --no-default-features --features "use-installed-tools"


android:
name: Android
strategy:
matrix:
os: [ ubuntu-latest ]
target: [ aarch64-linux-android ]
runs-on: ${{ matrix.os }}
env:
RUSTUP_UNPACK_RAM: "26214400"
RUSTUP_IO_THREADS: "1"
steps:
- uses: actions/checkout@v4
- name: Install Vulkan SDK
Expand All @@ -98,6 +110,11 @@ jobs:
stripdown: true
- name: install rust-toolchain
run: cargo version
- uses: Swatinem/rust-cache@v2
with:
add-job-id-key: "false"
shared-key: "android"
save-if: ${{ github.ref_name == 'main' }}
- name: cargo fetch --locked
run: cargo fetch --locked --target ${{ matrix.target }}

Expand Down Expand Up @@ -142,6 +159,11 @@ jobs:
stripdown: true
- name: install rust-toolchain
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
- uses: Swatinem/rust-cache@v2
with:
add-job-id-key: "false"
shared-key: "base"
save-if: "false"
- name: cargo fetch --locked
run: cargo fetch --locked --target $TARGET
- name: compiletest
Expand Down Expand Up @@ -177,12 +199,20 @@ jobs:
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- name: install rust-toolchain
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
- uses: Swatinem/rust-cache@v2
with:
add-job-id-key: "false"
shared-key: "base"
save-if: "false"
- uses: Swatinem/rust-cache@v2
with:
add-job-id-key: "false"
shared-key: "difftest"
workspaces: "tests/difftests/tests"
- name: cargo fetch --locked
run: cargo fetch --locked --target $TARGET
- name: cargo fetch --locked difftests
run: cargo fetch --locked --manifest-path=tests/difftests/tests/Cargo.toml --target $TARGET
- name: test difftest
run: cargo test -p "difftest*" --release --no-default-features --features "use-installed-tools"
- name: difftests
run: cargo run -p difftests --release --no-default-features --features "use-installed-tools"

Expand Down
Loading