name: "Checks: Lints, Tests, Docs" on: workflow_call: inputs: CONCURRENCY: required: true type: string PR_NUMBER: required: false type: string default: "" concurrency: group: ${{ inputs.CONCURRENCY }}-checks cancel-in-progress: true env: PYTHON_VERSION: "3.10" RUSTFLAGS: --deny warnings RUSTDOCFLAGS: --deny warnings # Do *not* use sscache since on contributor ci we don't have access to the gcloud stored cache. #RUSTC_WRAPPER: "sccache" # Not only `sccache` cannot cache incremental builds, it's counter-productive to generate all # these incremental artifacts when running on CI. CARGO_INCREMENTAL: "0" # Sourced from https://vulkan.lunarg.com/sdk/home#linux VULKAN_SDK_VERSION: "1.3.290.0" # ANSI color codes should be supported by default on GitHub Actions. CARGO_TERM_COLOR: always defaults: run: shell: bash --noprofile --norc -euo pipefail {0} permissions: contents: "read" jobs: py-lints: name: Python lints (ruff, mypy, …) timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Python format check run: pixi run py-fmt-check - name: Lint Python run: pixi run py-lint - name: Notebook strip check run: pixi run nb-strip-check py-test-docs: name: Test Python Docs timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Build via mkdocs run: | pixi run uv run --group docs mkdocs build --strict -f rerun_py/mkdocs.yml no-codegen-changes: name: Check if running codegen would produce any changes timeout-minutes: 60 runs-on: ubuntu-latest-16-cores steps: # Note: We explicitly don't override `ref` here. We need to see if changes would be made # in a context where we have merged with main. Otherwise we might miss changes such as one # PR introduces a new type and another PR changes the codegen. - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Codegen check run: pixi run codegen --force --check --warnings-as-errors - name: Codegen out-of-sync (protos) run: pixi run codegen-protos-check rs-lints: name: Rust lints (fmt, check, clippy, tests, doc) timeout-minutes: 60 runs-on: ubuntu-latest-16-cores steps: - uses: actions/checkout@v4 with: lfs: true - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 # Install the Vulkan SDK, so we can use the software rasterizer. # TODO(andreas): It would be nice if `setup_software_rasterizer.py` could do that for us as well (note though that this action here is very fast when cached!) - name: Install Vulkan SDK uses: rerun-io/install-vulkan-sdk-action@v1.1.0 with: vulkan_version: ${{ env.VULKAN_SDK_VERSION }} install_runtime: true cache: true stripdown: true - name: Setup software rasterizer run: pixi run python ./scripts/ci/setup_software_rasterizer.py # Recommended way to install nextest on CI. - name: Install latest nextest release uses: taiki-e/install-action@v2.48.7 with: tool: nextest@0.9.89 - name: Rust checks & tests run: pixi run rs-check --skip individual_crates docs_slow - name: Upload test results uses: actions/upload-artifact@v4 if: always() with: name: test-results-linux path: | **/tests/snapshots **/tests/failures rerun-lints: name: Rerun lints timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Rerun lints run: pixi run lint-rerun toml-format-check: name: Toml format check timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Toml format check run: pixi run toml-fmt-check check-too-large-files: name: Check for too large files timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Check for too large files run: pixi run check-large-files check-example-thumbnails: name: Check example thumbnails timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Check example thumbnails run: pixi run uvpy ./scripts/ci/thumbnails.py check check-doc-order: name: Check docs order timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Check docs order run: pixi run uvpy ./scripts/ci/check_doc_order.py check-no-d2-code-blocks: name: Check for D2 code blocks timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 - name: Check for D2 code blocks run: pixi run uvpy ./scripts/ci/check_d2_diagrams.py spell-check: name: Spell Check timeout-minutes: 60 runs-on: ubuntu-latest steps: - name: Checkout Actions Repository uses: actions/checkout@v4 - name: Check spelling of entire workspace uses: crate-ci/typos@v1.45.1 cpp-formatting: name: C++ formatting check timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 environments: cpp - name: Run clang format on all relevant files run: pixi run -e cpp cpp-fmt-check cpp-tests: name: C++ tests timeout-minutes: 60 runs-on: ubuntu-latest-16-cores steps: - uses: actions/checkout@v4 - uses: prefix-dev/setup-pixi@v0.10.0 with: pixi-version: v0.71.3 environments: cpp # TODO(emilk): make this work somehow. Right now this just results in # > Compiler: GNU 12.3.0 (/__w/rerun/rerun/.pixi/env/bin/x86_64-conda-linux-gnu-c++) # 😭 # - name: Build and run C++ tests with clang++ # run: | # pixi run -e cpp cpp-clean # RERUN_WERROR=ON RERUN_USE_ASAN=ON CXX=clang++ pixi run -e cpp cpp-build-all # RERUN_WERROR=ON RERUN_USE_ASAN=ON CXX=clang++ pixi run -e cpp cpp-test - name: Build and run C++ tests with g++ run: | pixi run -e cpp cpp-clean RERUN_WERROR=ON RERUN_USE_ASAN=ON LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp CXX=g++ pixi run -e cpp cpp-build-all RERUN_WERROR=ON RERUN_USE_ASAN=ON LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp CXX=g++ pixi run -e cpp cpp-test