Skip to content

Release 0.5.25

Release 0.5.25 #3278

Workflow file for this run

name: "Tests"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
# For pipefail - https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#exit-codes-and-error-action-preference
shell: bash
jobs:
linters:
name: linters
runs-on: [self-hosted, macos, arm64]
steps:
- uses: actions/checkout@v6
- id: setup
uses: ./.github/actions/setup
with:
linters: true
metal: true
- name: Check uzu-engine rustfmt discovery
if: ${{ always() && steps.setup.outcome == 'success' }}
run: RUSTUP_TOOLCHAIN=nightly ./scripts/check-rustfmt-discovery.sh
- name: Check Rust formatting
if: ${{ always() && steps.setup.outcome == 'success' }}
run: cargo +nightly fmt --check
- name: Check Metal formatting
if: ${{ always() && steps.setup.outcome == 'success' }}
run: ./scripts/clang-format.sh --check
- name: Lint with clippy
if: ${{ always() && steps.setup.outcome == 'success' }}
run: cargo +nightly clippy --workspace --all-targets -- -D warnings
- name: Check that Cargo.lock is consistent with Cargo.toml
if: ${{ always() && steps.setup.outcome == 'success' }}
run: |
cargo metadata --locked --format-version=1 > /dev/null
git diff --exit-code -- Cargo.lock
- name: Check with cargo-deny
if: ${{ always() && steps.setup.outcome == 'success' }}
run: cargo deny check -D warnings
- name: Check sync
if: ${{ always() && steps.setup.outcome == 'success' }}
run: cargo tools sync --check
tests:
name: ${{ matrix.host }}${{ matrix.target && format(' ({0})', matrix.target) }}
runs-on: ${{ matrix.host == 'linux' && 'uzu-n4std16' || fromJSON('["self-hosted","macos","arm64"]') }}
strategy:
matrix:
include:
- host: 'macos'
tests: true
benches: true
- host: 'linux'
crates: ['cli']
- host: 'linux'
target: 'wasm32-wasip1-threads'
nightly: true
crates: ['uzu']
tests: 'kernels'
- host: 'linux'
target: 'wasm32-unknown-unknown'
crates: ['kiban']
env:
CARGO_ENCODED_RUSTFLAGS: "-Dwarnings"
HF_TOKEN: ${{ secrets.HF_TOKEN }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
with:
metal: ${{ matrix.host == 'macos' && 'true' || 'false' }}
test_data: ${{ matrix.tests == true && 'true' || 'false' }}
nextest: ${{ matrix.tests && 'true' || 'false' }}
target: ${{ matrix.target }}
- name: Build crates
run: |
cargo +${{ matrix.nightly && 'nightly' || 'stable' }} build \
${{ matrix.target && format('--target {0}', matrix.target) || '' }} \
${{ matrix.crates && format('-p {0}', join(matrix.crates, ' -p ')) || '' }}
- name: Build benches
if: ${{ matrix.benches }}
run: |
cargo +nightly bench --no-run \
${{ matrix.target && format('--target {0}', matrix.target) || '' }} \
${{ matrix.crates && format('-p {0}', join(matrix.crates, ' -p ')) || '' }}
- name: Run tests
if: ${{ matrix.tests }}
run: |
cargo +nightly nextest run --profile=ci \
${{ matrix.target && format('--target {0}', matrix.target) || '' }} \
${{ matrix.tests == 'kernels' && '-p uzu-engine backends::common::kernel::tests --lib' || '' }}
validate-bindings:
name: validate-bindings
runs-on: [self-hosted, macos, arm64]
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup
with:
metal: true
bindings: true
- name: "Setup"
run: |
cargo tools setup
cargo tools install rust
cargo tools install python
cargo tools install swift
cargo tools install typescript
- name: "Verify"
id: verify
run: |
cargo tools verify
- name: "Print diff"
if: ${{ always() && steps.verify.outcome == 'failure' }}
run: git diff
- name: "Test"
run: |
cargo tools test python
cargo tools test swift
cargo tools test typescript
completed:
name: completed
runs-on: ubuntu-latest
needs: [linters, tests, validate-bindings]
if: ${{ always() }}
steps:
- run: |
[ "${{ needs.linters.result }}" = success ]
[ "${{ needs.tests.result }}" = success ]
[ "${{ needs.validate-bindings.result }}" = success ]