Skip to content

chore(lib): big cleanup, removing deprecated stuff (#537) #2651

chore(lib): big cleanup, removing deprecated stuff (#537)

chore(lib): big cleanup, removing deprecated stuff (#537) #2651

Workflow file for this run

# Test code base and upload coverage
name: Test code
on:
pull_request:
paths:
- '**/pyproject.toml'
- '**/Cargo.toml'
- uv.lock
- differt/**/.py
- differt-core/**/*.{py,rs}
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
QT_QPA_PLATFORM: offscreen
DISPLAY: :99
MPLBACKEND: agg
jobs:
download-scenes:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Generate cache key
id: cache-key
run: |
echo "result=$(curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -H 'Accept: application/vnd.github.VERSION.sha' 'https://api.github.com/repos/NVlabs/sionna-rt/commits/main')" >> $GITHUB_OUTPUT
- name: Cache scenes
id: cache-scenes
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: differt/src/differt/geometry/scenes
key: ${{ steps.cache-key.outputs.result }}-scenes
- name: Download Sionna scenes
if: steps.cache-scenes.outputs.cache-hit != 'true'
run: uv run differt/src/differt/geometry/_sionna.py
- name: List scenes
run: tree -L 2 differt/src/differt/geometry/scenes
- name: Upload scenes
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sionna-scenes
path: differt/src/differt/geometry/scenes
pytest:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
pyversion: ['3.11', '3.12', '3.13', '3.14']
resolution: [highest, lowest-direct]
include:
- pyversion: '3.11'
group: tests-matplotlib
- pyversion: '3.11'
group: tests-plotly
- pyversion: '3.11'
group: tests-vispy
- pyversion: '3.11'
os: ubuntu-latest
jaxtyping-packages: '' # Running without type checker
resolution: highest
exclude:
- os: windows-latest # bugs with NumPy
pyversion: '3.13'
- pyversion: '3.11'
resolution: lowest-direct
- pyversion: '3.12'
resolution: lowest-direct
runs-on: ${{ matrix.os }}
needs: [download-scenes]
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Install LLVM dependencies (Linux)
if: (matrix.os == 'ubuntu-latest') && (matrix.group != 'tests')
run: sudo apt-get install llvm
- name: Install LLVM dependencies (macOS)
if: (matrix.os == 'macos-latest') && (matrix.group != 'tests')
run: |
brew install llvm
echo "DRJIT_LIBLLVM_PATH=$(brew --prefix llvm)/lib/libLLVM.dylib" >> "$GITHUB_ENV"
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install freeglut3-dev xvfb
sudo apt-get install x11-utils
nohup Xvfb $DISPLAY -screen 0 1400x900x24 -dpi 96 +extension RANDR +render &
- name: Install Mesa (OpenGL on Windows)
if: matrix.os == 'windows-latest'
uses: ssciwr/setup-mesa-dist-win@2dfeaebfa514f74c2b8cd8d27108c31486d33e72 # v3.0.0
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Download scenes
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: sionna-scenes
path: differt/src/differt/geometry/scenes
- name: Run tests
run: uv run --python ${{ matrix.pyversion }} --resolution ${{ matrix.resolution }} --frozen --no-dev --group ${{ matrix.group || 'tests-extended' }} --exact -m pytest${{ matrix.jaxtyping-packages && format(' --jaxtyping-packages="{0}"', matrix.jaxtyping-packages) || '' }} --durations=10
- name: Upload to codecov.io
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.DIFFERT_CODECOV_TOKEN }}
fail_ci_if_error: true
cargo-test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
pyversion: ['3.11', '3.12', '3.13', '3.14']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.pyversion }}
- name: Install NumPy
run: pip install numpy
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run Cargo test
run: cargo test
cargo-tarpaulin:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
- name: Install NumPy
run: pip install numpy
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@742a3317eac7bd62f91cd888b4eead5e784ba833 # v2.87.1
with:
tool: cargo-tarpaulin@0.31.2
- name: Generate code coverage
run: cargo tarpaulin --verbose --timeout 120 --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.DIFFERT_CODECOV_TOKEN }}
fail_ci_if_error: true
python-benchmark:
runs-on: ubuntu-latest
needs: [download-scenes]
env:
UV_PYTHON: 3.12
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ env.UV_PYTHON}}
- name: Setup uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Download scenes
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: sionna-scenes
path: differt/src/differt/geometry/scenes
- name: Run CodSpeed benchmarks
uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1
with:
mode: simulation
run: uv run --group=codspeed pytest differt/tests/benchmarks --codspeed
rust-benchmark:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
- name: Install NumPy
run: pip install numpy
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2
- name: Run Benchmarks
run: cargo bench
linkcheck-docs:
runs-on: ubuntu-latest
needs: [download-scenes]
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download scenes
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: sionna-scenes
path: differt/src/differt/geometry/scenes
- name: Setup uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Install Just
uses: taiki-e/install-action@742a3317eac7bd62f91cd888b4eead5e784ba833 # v2.87.1
with:
tool: just@1.58.0
- name: Install dependencies
run: just install --locked --no-dev --group docs
- name: Check links in documentation
run: just docs/linkcheck