chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:05:14 +08:00
commit 2a547be7fe
7904 changed files with 1000926 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
# Overview
Our CI workflows make heavy usage of [Reusable Workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows). These reusable workflows can then be tested manually via the `manual_dispatch.yml` workflow.
Or integrated into CI jobs such has `on_pull_request.yml` or `on_main.yml`.
By convention:
- All reusable workflows start with the `reusable_` prefix.
- All workflows that are triggered via `workflow_dispatch` start with the `manual_` prefix.
- All workflows that are triggered via an event start with the `on_` prefix.
- `on_pull_request` is triggered on pull requests.
- `on_push_main` is triggered on pushes to the main branch.
If you are going to be doing any editing of workflows, the
[VS Code extension](https://marketplace.visualstudio.com/items?itemName=cschleiden.vscode-github-actions)
for GitHub Actions is highly recommended.
+122
View File
@@ -0,0 +1,122 @@
name: Adhoc Wheels
on:
workflow_dispatch:
inputs:
MODE:
type: choice
required: false
options:
- pypi
- pr
- extra
description: "The build mode (`pypi` includes the web viewer, `pr` does not)"
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
deployments: "write"
packages: "read"
jobs:
# -----------------------------------------------------------------------------------
# Build rerun-cli (rerun binaries):
build-rerun-cli-and-upload-linux-arm64:
name: "Linux-arm64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: adhoc-wheels-linux-arm64
PLATFORM: linux-arm64
secrets: inherit
build-rerun-cli-and-upload-linux-x64:
name: "Linux-x64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: adhoc-wheels-linux-x64
PLATFORM: linux-x64
secrets: inherit
build-rerun-cli-and-upload-macos-arm64:
name: "Mac-arm64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: adhoc-wheels-macos-arm64
PLATFORM: macos-arm64
secrets: inherit
build-rerun-cli-and-upload-windows-x64:
name: "Windows-x64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: adhoc-wheels-windows-x64
PLATFORM: windows-x64
secrets: inherit
# ---------------------------------------------------------------------------
# Build wheels:
build-wheel-linux-arm64:
needs: [build-rerun-cli-and-upload-linux-arm64]
name: "Linux-arm64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: adhoc-wheels-linux-arm64
PLATFORM: linux-arm64
WHEEL_ARTIFACT_NAME: linux-arm64-wheel
MODE: ${{ inputs.MODE }}
secrets: inherit
build-wheel-linux-x64:
needs: [build-rerun-cli-and-upload-linux-x64]
name: "Linux-x64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: adhoc-wheels-linux-x64
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: linux-x64-wheel
MODE: ${{ inputs.MODE }}
secrets: inherit
build-wheel-macos-arm64:
needs: [build-rerun-cli-and-upload-macos-arm64]
name: "Macos-arm64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: adhoc-wheels-macos-arm64
PLATFORM: macos-arm64
WHEEL_ARTIFACT_NAME: macos-arm64-wheel
MODE: ${{ inputs.MODE }}
secrets: inherit
build-wheel-windows-x64:
needs: [build-rerun-cli-and-upload-windows-x64]
name: "Windows-x64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: adhoc-wheels-windows-x64
PLATFORM: windows-x64
WHEEL_ARTIFACT_NAME: windows-x64-wheel
MODE: "pypi"
secrets: inherit
# --------------------------------------------------------------------------
generate-pip-index:
name: "Generate Pip Index"
needs:
[
build-wheel-linux-arm64,
build-wheel-linux-x64,
build-wheel-macos-arm64,
build-wheel-windows-x64,
]
uses: ./.github/workflows/reusable_pip_index.yml
with:
CONCURRENCY: adhoc-wheels
secrets: inherit
+41
View File
@@ -0,0 +1,41 @@
name: "Approve Workflow Runs"
on:
pull_request_target:
issue_comment:
types: [created, edited]
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
actions: "write"
jobs:
approve-workflow-runs:
name: "Check for approval"
runs-on: ubuntu-latest
if: |
github.event.pull_request.head.repo.owner.login != 'rerun-io' &&
(github.event_name == 'pull_request_target' || github.event.issue.pull_request)
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Wait a few seconds
run: |
# Give GitHub a bit of time to synchronize everything
sleep 5s
- name: Approve workflow runs
run: |
pixi run python scripts/ci/approve_workflow_runs.py \
--github-token "${{ secrets.GITHUB_TOKEN }}" \
--github-repository "rerun-io/rerun" \
--pr-number "${{ github.event.pull_request.number || github.event.issue.number }}"
+69
View File
@@ -0,0 +1,69 @@
name: Docs deploy
on:
push:
branches: [main]
permissions:
contents: "read"
id-token: "write"
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
# The lack of `concurrency` is intentional.
# We want this job to run on every commit, even if multiple are merged in a row.
jobs:
has-label:
name: Check for PR label
runs-on: ubuntu-latest
outputs:
result: ${{ steps.find-pr.outputs.result }}
steps:
- uses: actions/checkout@v3
with:
# ref - not set, because we want to end up on the merge commit
fetch-depth: 0 # don't perform a shallow clone
# Find the PR by the number in the merge commit subject line
- name: Find PR
id: find-pr
env:
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
commit_message=$(git log --pretty=format:%s -n 1 ${{ github.sha }})
pr_number=$(python3 scripts/ci/parse_pr_number.py "$commit_message" 2>/dev/null || true)
# Exported commits don't have PR numbers - skip them
if [ -z "$pr_number" ]; then
echo "No PR number found in commit message, skipping"
echo "result=false" >> $GITHUB_OUTPUT
exit 0
fi
result=$(gh pr view $pr_number --json labels | jq -r 'any(.labels[].name; . == "deploy docs")')
echo "result=$result" >> $GITHUB_OUTPUT
cherry-pick:
name: Cherry-pick to docs-latest
needs: [has-label]
if: needs.has-label.outputs.result == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.RERUN_BOT_TOKEN }}
- name: Cherry-pick
run: |
# Setup git user
git config --global user.name "rerun-bot"
git config --global user.email "bot@rerun.io"
# Cherry-pick the commit
git checkout docs-latest
git cherry-pick ${{ github.sha }}
git push origin docs-latest
+83
View File
@@ -0,0 +1,83 @@
name: Docs deploy pre-check
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
concurrency:
group: pr-${{ github.event.pull_request.number }}-auto-docs-check
cancel-in-progress: true
jobs:
check-cherry-pick:
name: Check if merge commit can be cherry-picked
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && contains(github.event.pull_request.labels.*.name, 'deploy docs')
steps:
- uses: actions/checkout@v3
with:
# ref - not set, because we want to end up on the merge commit
fetch-depth: 0 # don't perform a shallow clone
- name: Try cherry-pick
env:
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
# Setup git user
git config --global user.name "rerun-bot"
git config --global user.email "bot@rerun.io"
git fetch origin main
git checkout main
git merge --squash origin/${{ github.event.pull_request.head.ref }}
git commit -m "${{ github.event.pull_request.head.title }} (#${{ github.event.pull_request.number }})"
commit=$(git rev-parse HEAD)
git checkout docs-latest
if git cherry-pick $commit; then
echo "Cherry-pick successful"
exit 0
else
echo "Cherry-pick failed"
printf $(git diff)
exit 1
fi
- name: Add success comment
# https://github.com/mshick/add-pr-comment
uses: mshick/add-pr-comment@v3.9.1
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment on success.
continue-on-error: true
if: success()
with:
message-id: "cherry-pick-check"
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
Your changes can be cherry-picked to `docs-latest` and will be deployed
immediately after merging.
- name: Add failure comment
# https://github.com/mshick/add-pr-comment
uses: mshick/add-pr-comment@v3.9.1
if: failure()
with:
message-id: "cherry-pick-check"
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
Your changes cannot be automatically cherry-picked to `docs-latest`.
You should remove the `deploy docs` label and perform the cherry-pick manually after merging.
+35
View File
@@ -0,0 +1,35 @@
name: Cargo Shear
on:
push:
branches:
- "main"
pull_request:
types: [opened, synchronize]
jobs:
cargo-shear:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
# The snippets crate has a build.rs that generates src/snippets/*.rs from all/*/*.rs.
# Without this step, cargo-shear can't deduce requirements from the generated code.
- name: Regenerate snippets
run: |
cargo check -p snippets
- name: Install Cargo Shear
uses: taiki-e/install-action@v2.48.7
with:
tool: cargo-shear@1.11.2
# TODO(Boshen/cargo-shear#468): enable warnings as errors once we can ignore no (doc) test warnings.
- name: Run Cargo Shear
run: |
cargo shear
+42
View File
@@ -0,0 +1,42 @@
# Checks that all checkboxes in a PR are checked
name: Pull Request Checkboxes
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- edited
concurrency:
group: ${{ github.event.pull_request.number }}-pr-checkboxes
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
pull-requests: "read"
jobs:
pr-checkboxes:
name: Check PR checkboxes
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Check PR checkboxes
run: |
pixi run ./scripts/ci/check_pr_checkboxes.py \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--github-repository ${{ github.repository }} \
--pr-number ${{ github.event.pull_request.number }}
+61
View File
@@ -0,0 +1,61 @@
name: Clear cache
on:
workflow_dispatch:
permissions:
actions: write
jobs:
clear-cache:
runs-on: ubuntu-latest
steps:
- name: Clear cache
uses: actions/github-script@v6
with:
script: |
const opts = {
owner: context.repo.owner,
repo: context.repo.repo,
};
const cache_list = await github.rest.actions.getActionsCacheList({
per_page: 1,
...opts,
});
const per_page = 100;
const pages = Math.ceil(cache_list.data.total_count / per_page);
const total_count = cache_list.data.total_count;
let deleted = 0;
const _id = setInterval(() => {
console.log(`${deleted}/${total_count}`);
}, 500);
let promises = [];
for (let page = 1; page <= pages; page++) {
const cache_page = await github.rest.actions.getActionsCacheList({
per_page,
page,
...opts,
});
for (const cache of cache_page.data.actions_caches) {
promises.push(
github.rest.actions
.deleteActionsCacheById({
cache_id: cache.id,
...opts,
})
.then(() => (deleted += 1))
);
}
await Promise.all(promises);
promises = [];
// wait 60 seconds every 4 pages (secondary rate limit)
if (page % 4 === 0) {
await new Promise(f => setTimeout(f, 60_000));
}
}
clearInterval(_id);
+284
View File
@@ -0,0 +1,284 @@
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
+86
View File
@@ -0,0 +1,86 @@
name: Reusable Build and Test Wheels (contrib)
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
MATURIN_FEATURE_FLAGS:
required: false
type: string
default: "--no-default-features --features pypi"
concurrency:
group: ${{ inputs.CONCURRENCY }}-build-wheels
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"
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
packages: "read"
jobs:
build-wheels:
name: Build Wheels
runs-on: ubuntu-latest-16-cores
timeout-minutes: 60
container:
image: ghcr.io/rerun-io/ci_docker:0.18.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Build rerun-cli
run: |
pixi run rerun-build-native-and-web-release
- name: Copy rerun-cli to wheel folder
run: |
cp target/release/rerun rerun_py/rerun_sdk/rerun_cli
- name: Build the wheel
run: |
pixi run uvpy scripts/ci/build_and_upload_wheels.py \
--mode pr \
--target x86_64-unknown-linux-gnu \
--dir unused \
--compat manylinux_2_28
- name: Install built wheel
run: |
pixi run python scripts/ci/uv_install_wheel.py --package rerun-sdk --dir dist/x86_64-unknown-linux-gnu
- name: Run e2e test
run: RUST_LOG=debug pixi run uvpy scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed
- name: Run docs/snippets/compare_snippet_output.py
# --release so we can inherit from some of the artifacts that maturin has just built before
# --target x86_64-unknown-linux-gnu because otherwise cargo loses the target cache… even though this is the target anyhow…
# --no-py-build because rerun-sdk is already built and installed
run: |
RUST_LOG=debug pixi run uvpy docs/snippets/compare_snippet_output.py --release --target x86_64-unknown-linux-gnu --no-py-build
+40
View File
@@ -0,0 +1,40 @@
{
"include": [
{
"name": "Linux x64, C++17",
"runs_on": "ubuntu-latest-16-cores",
"cache_key": "cpp-linux-cpp17",
"extra_env_vars": "RERUN_USE_ASAN=1 RERUN_SET_CXX_VERSION=17 LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp",
"additional_commands": "pixi run -e cpp cpp-docs",
"pr_ci": true
},
{
"name": "Linux x64, C++20 (skipped on PRs)",
"runs_on": "ubuntu-latest-16-cores",
"cache_key": "cpp-linux-cpp20",
"extra_env_vars": "RERUN_USE_ASAN=1 RERUN_SET_CXX_VERSION=20 LSAN_OPTIONS=suppressions=.github/workflows/lsan_suppressions.supp",
"pr_ci": false
},
{
"name": "Windows x64, C++17",
"runs_on": "windows-latest-8-cores",
"cache_key": "cpp-windows-cpp17",
"extra_env_vars": "RERUN_SET_CXX_VERSION=17",
"pr_ci": true
},
{
"name": "Windows x64, C++20 (skipped on PRs)",
"runs_on": "windows-latest-8-cores",
"cache_key": "cpp-windows-cpp20",
"extra_env_vars": "RERUN_SET_CXX_VERSION=20",
"pr_ci": false
},
{
"name": "Mac aarch64",
"runs_on": "macos-26-xlarge",
"cache_key": "cpp-macos-arm64",
"extra_env_vars": "",
"pr_ci": true
}
]
}
+42
View File
@@ -0,0 +1,42 @@
name: PR Branch Name Check
on:
pull_request_target:
types: [opened, reopened, synchronize]
permissions:
issues: write
jobs:
check-source-branch:
runs-on: ubuntu-latest
steps:
- name: Check PR source branch
env:
IS_FORK: ${{ github.event.pull_request.head.repo.fork }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
# Check if PR is from a fork
if [[ "$IS_FORK" == "true" ]]; then
# Check if PR is from the master/main branch of a fork
if [[ "$HEAD_REF" == "master" || "$HEAD_REF" == "main" ]]; then
echo "ERROR: Pull requests from the master/main branch of forks are not allowed, because it prevents maintainers from contributing to your PR"
echo "Please create a feature branch in your fork and submit the PR from that branch instead."
exit 1
fi
fi
- name: Leave comment if PR is from master/main branch of fork d
if: ${{ failure() }}
uses: actions/github-script@v7
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '⚠️ **ERROR:** Pull requests from the `master`/`main` branch of forks are not allowed, because it prevents maintainers from contributing to your PR. Please create a feature branch in your fork and submit the PR from that branch instead.'
})
+22
View File
@@ -0,0 +1,22 @@
name: First time contributors
on:
pull_request_target:
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
jobs:
comment:
name: Comment on PRs
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1.3.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: |
Hi! Thanks for opening this pull request.
Because this is your first time contributing to this repository, make sure you've read our [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md).
+83
View File
@@ -0,0 +1,83 @@
# https://github.com/marketplace/actions/require-labels
# Check for existence of labels
# See all our labels at https://github.com/rerun-io/rerun/issues/labels
name: Pull Request Labels
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
# No permissions needed here
# permissions:
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Check for a "do-not-merge" label
uses: mheap/github-action-required-labels@v3
with:
mode: exactly
count: 0
labels: "do-not-merge"
- name: Require label "include in changelog" or "exclude from changelog"
uses: mheap/github-action-required-labels@v3
with:
mode: minimum
count: 1
labels: "exclude from changelog, include in changelog"
- name: Require at least one label
uses: mheap/github-action-required-labels@v3
with:
mode: minimum
count: 1
#NOLINT_START: skip lint rules on labels (dataplatform)
labels: "📊 analytics, 🟦 blueprint, 🪳 bug, CLI, codegen/idl, 🧑‍💻 dev experience, dependencies, 📖 documentation, 💬 discussion, examples, exclude from changelog, 🪵 Log & send APIs, 📉 performance, sdk-python, sdk-cpp, sdk-rust, ⛃ re_datastore, 🔍 re_query, 📺 re_viewer, 🔺 re_renderer, 🚜 refactor, ⛴ release, 🔨 testing, ui, 🕸️ web, 🧢 MCAP, OSS-server, dataplatform"
#NOLINT_END
wasm-bindgen-check:
name: Check wasm-bindgen version
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Get current wasm-bindgen version
id: current-version
run: |
version=$(pixi run taplo get -f crates/viewer/re_viewer/Cargo.toml "target.*.dependencies.wasm-bindgen")
echo "current_version=$version" >> $GITHUB_OUTPUT
- name: Get previous wasm-bindgen version
id: previous-version
run: |
prev_ref=$(git rev-parse --abbrev-ref HEAD)
git checkout main
version=$(pixi run taplo get -f crates/viewer/re_viewer/Cargo.toml "target.*.dependencies.wasm-bindgen")
echo "previous_version=$version" >> $GITHUB_OUTPUT
git checkout $prev_ref
- name: Require label if versions changed
if: ${{ steps.current-version.outputs.current_version != steps.previous-version.outputs.previous_version }}
uses: mheap/github-action-required-labels@v3
with:
mode: exactly
count: 1
labels: "wasm-bindgen version update"
+1
View File
@@ -0,0 +1 @@
leak:null_arrow_array
+440
View File
@@ -0,0 +1,440 @@
name: Nightly
on:
workflow_dispatch:
schedule:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# 3am UTC, so 4am-5am CET and evening in east time, basically after everyone's day.
- cron: "15 3 * * *"
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
deployments: "write"
# This is needed since the web viewer build has this permission in order to write comments in PRs
# (not needed for nightly, but the permission is still active).
pull-requests: "write"
packages: "read"
jobs:
checks:
name: Checks
uses: ./.github/workflows/reusable_checks.yml
with:
CONCURRENCY: nightly
CHANNEL: nightly
secrets: inherit
checks-cpp:
name: Checks
uses: ./.github/workflows/reusable_checks_cpp.yml
with:
CONCURRENCY: nightly
CHANNEL: nightly
secrets: inherit
checks-rust:
name: Checks
uses: ./.github/workflows/reusable_checks_rust.yml
with:
CONCURRENCY: nightly
CHANNEL: nightly
secrets: inherit
checks-python:
name: Checks
uses: ./.github/workflows/reusable_checks_python.yml
with:
CONCURRENCY: nightly
secrets: inherit
# Check that a CLEAN container with just `cargo` on it can build rerun:
clean-build:
timeout-minutes: 60
name: cargo build on clean container
strategy:
matrix:
runs_on:
[ubuntu-latest-16-cores, macos-26-xlarge, windows-latest-8-cores]
runs-on: ${{ matrix.runs_on }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.92.0
- run: cargo build -p rerun # Intentionally NOT using pixi, because we wanna check that we can build outside of pixi
build-web:
name: "Build web viewer"
uses: ./.github/workflows/reusable_build_web.yml
with:
CONCURRENCY: nightly
CHANNEL: nightly
secrets: inherit
upload-web:
name: "Upload Web"
needs: [build-web]
uses: ./.github/workflows/reusable_upload_web.yml
with:
CONCURRENCY: nightly
NIGHTLY: true
secrets: inherit
build-js:
name: "Build JS"
uses: ./.github/workflows/reusable_build_js.yml
with:
CONCURRENCY: nightly
secrets: inherit
upload-js:
name: "Upload JS"
needs: [build-js]
uses: ./.github/workflows/reusable_upload_js.yml
with:
CONCURRENCY: nightly
NIGHTLY: true
secrets: inherit
# -----------------------------------------------------------------------------------
# Build rerun_c library binaries:
build-rerun_c-and-upload-linux-arm64:
needs: [checks]
name: "Linux-Arm64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: nightly-linux-arm64
PLATFORM: linux-arm64
secrets: inherit
build-rerun_c-and-upload-linux-x64:
needs: [checks]
name: "Linux-x64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: nightly-linux-x64
PLATFORM: linux-x64
secrets: inherit
build-rerun_c-and-upload-macos-arm64:
needs: [checks]
name: "Mac-Arm64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: nightly-macos-arm64
PLATFORM: macos-arm64
secrets: inherit
build-rerun_c-and-upload-windows-x64:
needs: [checks]
name: "Windows-x64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: nightly-windows-x64
PLATFORM: windows-x64
secrets: inherit
# -----------------------------------------------------------------------------------
# Build rerun-cli (rerun binaries):
build-rerun-cli-and-upload-linux-arm64:
needs: [checks]
name: "Linux-arm64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: nightly-linux-arm64
PLATFORM: linux-arm64
secrets: inherit
build-rerun-cli-and-upload-linux-x64:
needs: [checks]
name: "Linux-x64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: nightly-linux-x64
PLATFORM: linux-x64
secrets: inherit
build-rerun-cli-and-upload-macos-arm64:
needs: [checks]
name: "Mac-arm64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: nightly-macos-arm64
PLATFORM: macos-arm64
secrets: inherit
build-rerun-cli-and-upload-windows-x64:
needs: [checks]
name: "Windows-x64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: nightly-windows-x64
PLATFORM: windows-x64
secrets: inherit
# ---------------------------------------------------------------------------
# Build wheels:
build-wheel-linux-arm64:
needs: [checks, build-rerun-cli-and-upload-linux-arm64]
name: "Linux-arm64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: nightly-linux-arm64
PLATFORM: linux-arm64
WHEEL_ARTIFACT_NAME: linux-arm64-wheel
MODE: "pypi"
secrets: inherit
build-wheel-linux-x64:
needs: [checks, build-rerun-cli-and-upload-linux-x64]
name: "Linux-x64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: nightly-linux-x64
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: linux-x64-wheel
MODE: "pypi"
secrets: inherit
build-wheel-macos-arm64:
needs: [checks, build-rerun-cli-and-upload-macos-arm64]
name: "Macos-arm64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: nightly-macos-arm64
PLATFORM: macos-arm64
WHEEL_ARTIFACT_NAME: macos-arm64-wheel
MODE: "pypi"
secrets: inherit
build-wheel-windows-x64:
needs: [checks, build-rerun-cli-and-upload-windows-x64]
name: "Windows-x64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: nightly-windows-x64
PLATFORM: windows-x64
WHEEL_ARTIFACT_NAME: windows-x64-wheel
MODE: "pypi"
secrets: inherit
# ---------------------------------------------------------------------------
# Test wheels:
test-wheel-linux-arm64:
needs: [checks, build-wheel-linux-arm64]
name: "linux-arm64: Test Wheels"
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: nightly-linux-arm64
PLATFORM: linux-arm64
WHEEL_ARTIFACT_NAME: linux-arm64-wheel
secrets: inherit
test-wheel-linux-x64:
needs: [checks, build-wheel-linux-x64]
name: "Linux-x64: Test Wheels"
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: nightly-linux-x64
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: linux-x64-wheel
secrets: inherit
test-wheel-macos-arm64:
needs: [checks, build-wheel-macos-arm64]
name: "macos-arm64: Test Wheels"
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: nightly-macos-arm64
PLATFORM: macos-arm64
WHEEL_ARTIFACT_NAME: macos-arm64-wheel
secrets: inherit
test-wheel-windows-x64:
needs: [checks, build-wheel-windows-x64]
name: "Windows-x64: Test Wheels"
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: nightly-windows-x64
PLATFORM: windows-x64
WHEEL_ARTIFACT_NAME: windows-x64-wheel
secrets: inherit
# ---------------------------------------------------------------------------
# TODO(#9304): make the notebook export work
# run-notebook:
# name: "Run Notebook"
# needs: [build-wheel-linux-x64]
# uses: ./.github/workflows/reusable_run_notebook.yml
# with:
# CONCURRENCY: nightly
# WHEEL_ARTIFACT_NAME: linux-x64-wheel
# secrets: inherit
build-examples:
name: "Build Examples"
needs: [build-wheel-linux-x64]
uses: ./.github/workflows/reusable_build_examples.yml
with:
CONCURRENCY: nightly
CHANNEL: nightly
WHEEL_ARTIFACT_NAME: linux-x64-wheel
secrets: inherit
upload-examples:
name: "Upload Examples"
needs: [build-examples]
uses: ./.github/workflows/reusable_upload_examples.yml
with:
CONCURRENCY: nightly
NIGHTLY: true
secrets: inherit
benches:
name: Benchmarks
uses: ./.github/workflows/reusable_bench.yml
with:
CONCURRENCY: nightly
SAVE_BENCHES: true
BENCH_NAME: main # We currently only run benches nightly, but we used to run them on main
COMPARE_TO: main # We currently only run benches nightly, but we used to run them on main
secrets: inherit
# --------------------------------------------------------------------------
# Release:
generate-pip-index:
name: "Generate Pip Index"
needs:
[
build-wheel-linux-arm64,
build-wheel-linux-x64,
build-wheel-macos-arm64,
build-wheel-windows-x64,
]
uses: ./.github/workflows/reusable_pip_index.yml
with:
CONCURRENCY: nightly
secrets: inherit
bundle-and-upload-rerun_cpp:
name: "Bundle and upload rerun_cpp_sdk.zip"
needs:
[
build-rerun_c-and-upload-linux-arm64,
build-rerun_c-and-upload-linux-x64,
build-rerun_c-and-upload-macos-arm64,
build-rerun_c-and-upload-windows-x64,
]
uses: ./.github/workflows/reusable_bundle_and_upload_rerun_cpp.yml
with:
CONCURRENCY: nightly
secrets: inherit
pre-release:
timeout-minutes: 60
name: Pre Release
concurrency: nightly
needs:
[
build-rerun-cli-and-upload-linux-arm64,
build-rerun-cli-and-upload-linux-x64,
build-rerun-cli-and-upload-macos-arm64,
build-rerun-cli-and-upload-windows-x64,
build-rerun_c-and-upload-linux-arm64,
build-rerun_c-and-upload-linux-x64,
build-rerun_c-and-upload-macos-arm64,
build-rerun_c-and-upload-windows-x64,
bundle-and-upload-rerun_cpp,
generate-pip-index,
upload-web,
]
runs-on: "ubuntu-latest"
steps:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${{github.sha}} | cut -c1-7`" >> $GITHUB_ENV
# First delete the old prerelease. If we don't do this, we don't get things like
# proper source-archives and changelog info.
# https://github.com/dev-drprasad/delete-tag-and-release
- uses: dev-drprasad/delete-tag-and-release@v0.2.1
with:
tag_name: prerelease
delete_release: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Create the actual prerelease
# https://github.com/ncipollo/release-action
- name: GitHub Release
uses: ncipollo/release-action@v1.12.0
with:
body: |
This is a prerelease. It is not intended for production use.
Please report any issues you find.
## Example Hosted App
https://rerun.io/viewer/commit/${{ env.SHORT_SHA }}
## Wheels can be installed with:
```
pip install --pre --no-index -f https://build.rerun.io/commit/${{ env.SHORT_SHA }}/wheels --upgrade rerun-sdk
```
or
```
pip install --pre --no-index -f https://github.com/rerun-io/rerun/releases/download/prerelease --upgrade rerun-sdk
```
## CMake fetch-content for C++ SDK
```
include(FetchContent)
FetchContent_Declare(rerun_sdk URL https://build.rerun.io/commit/${{ env.SHORT_SHA }}/rerun_cpp_sdk.zip)
FetchContent_MakeAvailable(rerun_sdk)
```
or
```
include(FetchContent)
FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/prerelease/rerun_cpp_sdk.zip)
FetchContent_MakeAvailable(rerun_sdk)
```
## Web Viewer NPM package
Can be installed with:
```
npm install https://build.rerun.io/commit/${{ env.SHORT_SHA }}/rerun_js
```
prerelease: true
# Be explicit about the commit we're releasing/tagging.
# Otherwise it can happen that there's a discrepancy between the tag and the commit for which we uploaded & linked artifacts.
# It seems to otherwise use the latest commit for the tag. From the actions's docs:
# > If the tag of the release you are creating does not yet exist, you should set both the tag and commit action inputs.
# We just deleted the previous tag, so this is the case!
commit: ${{github.sha}}
name: "Development Build"
tag: "prerelease"
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: false
allowUpdates: true
removeArtifacts: true
replacesArtifacts: true
sync-release-assets:
needs: [pre-release]
name: "Sync pre-release assets & build.rerun.io"
uses: ./.github/workflows/reusable_sync_release_assets.yml
with:
CONCURRENCY: nightly
RELEASE_VERSION: prerelease
secrets: inherit
+54
View File
@@ -0,0 +1,54 @@
name: Notify Reality of Sync Branch Update
# When a PR that was synced from reality is updated on the rerun side,
# trigger a re-run of the verification workflow on the reality PR.
# This ensures the reality PR's "verify-rerun-sync" check reflects the
# current state of the rerun branch.
on:
pull_request_target:
types: [synchronize]
jobs:
notify-reality:
runs-on: ubuntu-latest
steps:
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.SYNC_APP_ID }}
private-key: ${{ secrets.SYNC_APP_PRIVATE_KEY }}
owner: rerun-io
repositories: |
reality
rerun
- name: Re-run reality verification
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
SYNC_APP_ID: ${{ vars.SYNC_APP_ID }}
run: |
# Find reality PR number from sync comment (only from our app for security)
REALITY_PR=$(gh api "repos/rerun-io/rerun/issues/$PR_NUMBER/comments" \
| jq -r --arg app_id "$SYNC_APP_ID" '.[] | select(.performed_via_github_app.id | tostring == $app_id) | .body' \
| grep -oP 'reality/pull/\K\d+' | head -1)
if [[ -z "$REALITY_PR" ]]; then
echo "No reality PR reference found in bot comments - not a synced PR"
exit 0
fi
echo "Found reality PR #$REALITY_PR"
# Find and re-run the verification workflow for that PR
RUN_ID=$(gh api "repos/rerun-io/reality/actions/workflows/sync-pr-to-rerun.yml/runs?event=pull_request&per_page=100" \
--jq ".workflow_runs[] | select(.pull_requests[].number == $REALITY_PR) | .id" | head -1)
if [[ -n "$RUN_ID" ]]; then
echo "Re-running workflow run $RUN_ID"
gh api "repos/rerun-io/reality/actions/runs/$RUN_ID/rerun" -X POST
else
echo "No workflow run found for reality PR #$REALITY_PR"
fi
+56
View File
@@ -0,0 +1,56 @@
name: "GitHub Release"
on:
# Triggers when the `Publish release` button is pressed
release:
types: [published]
# Manual trigger with `tag` input
workflow_dispatch:
inputs:
tag_name:
description: "Release tag"
type: string
required: true
concurrency:
group: "release-${{ github.event.release.tag_name }}"
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
# required for updating the release
contents: write
id-token: write
jobs:
sync-release-assets:
name: "Sync Release Assets"
uses: ./.github/workflows/reusable_sync_release_assets.yml
with:
CONCURRENCY: "${{ github.event.release.tag_name || inputs.tag_name }}"
RELEASE_VERSION: "${{ github.event.release.tag_name || inputs.tag_name }}"
secrets: inherit
dispatch-gradio-rerun-viewer:
name: "Trigger gradio-rerun-viewer release"
# Only on real GH release events (not workflow_dispatch), and only for finals.
if: github.event_name == 'release' && !github.event.release.prerelease
runs-on: ubuntu-latest
steps:
- name: Send repository_dispatch
env:
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
version="${{ github.event.release.tag_name }}"
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag $version is not a final X.Y.Z release; skipping."
exit 0
fi
gh api repos/rerun-io/gradio-rerun-viewer/dispatches \
-f event_type=rerun-released \
-F client_payload[version]="$version" \
-F client_payload[source_release_url]="${{ github.event.release.html_url }}"
+130
View File
@@ -0,0 +1,130 @@
# This workflow is triggered on any PR comment, and tries to find a `@rerun-bot` mention in it.
# If the mention is a command, such as `@rerun-bot full-check`, then it runs the command.
#
# Available commands:
# full-check Triggers a run of `on_push_main.yml` on the PR.
name: "PR Comment"
on:
issue_comment:
types: [created]
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
jobs:
parse-command:
if: |
contains(github.event.comment.html_url, '/pull/') &&
contains(github.event.comment.body, '@rerun-bot') &&
contains(
fromJSON('["COLLABORATOR","MEMBER","OWNER"]'),
github.event.comment.author_association
)
runs-on: ubuntu-latest
outputs:
command: ${{ steps.parse.outputs.command }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Parse comment
id: parse
env:
GITHUB_COMMENT_BODY: "${{ github.event.comment.body }}"
run: python ./scripts/ci/parse_bot_pr_comment.py
full-check:
needs: [parse-command]
if: needs.parse-command.outputs.command == 'full-check'
runs-on: ubuntu-latest
steps:
- name: Acknowledge command (eyes reaction)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api -X POST \
/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
-f content=eyes
- name: Checkout repository
uses: actions/checkout@v4
- name: Dispatch main workflow
id: dispatch
env:
# NOTE: This uses `RERUN_BOT_TOKEN` instead of `GITHUB_TOKEN`,
# otherwise the recursive workflow protection prevents us from
# starting the `on_push_main` run.
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
get_latest_workflow_run () {
local workflow_name=$1
local ref_name=$2
local created_after=$3
echo $(
# https://cli.github.com/manual/gh_run_list
# https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates
gh run list \
--workflow $workflow_name \
--event workflow_dispatch \
--branch $ref_name \
--created ">$created_after" \
--json databaseId
)
}
dispatch_workflow () {
local workflow_name=$1
local ref_name=$2
local inputs=$3
# https://cli.github.com/manual/gh_workflow_run
echo $inputs | gh workflow run $workflow_name --ref "refs/heads/$ref_name" --json
}
workflow_name='on_push_main.yml'
ref_name=$(gh pr view ${{ github.event.issue.number }} --json headRefName | jq -r '.headRefName')
inputs='{"CONCURRENCY":"pr-${{ github.event.issue.number }}-full-check"}'
now=$(date --utc --iso-8601=seconds)
echo "Dispatching workflow $workflow_name on branch $ref_name"
dispatch_workflow $workflow_name $ref_name $inputs
# `gh workflow run` does NOT return the ID.
# In fact, it returns absolutely nothing: https://github.com/cli/cli/issues/4001
# Instead, we have to wait for the workflow to start, and hope that nobody has
# started a workflow in parallel with us on the same branch.
echo "Fetching workflow run id…"
run_info=$(get_latest_workflow_run $workflow_name $ref_name $now)
echo $run_info
run_id=$(echo $run_info | jq -r '.[0].databaseId')
while [ $run_id == 'null' ]
do
run_info=$(get_latest_workflow_run $workflow_name $ref_name $now)
echo $run_info
run_id=$(echo $run_info | jq -r '.[0].databaseId')
sleep 1
done
echo "Workflow run: https://github.com/rerun-io/rerun/actions/runs/$run_id"
echo "workflow_run_url=https://github.com/rerun-io/rerun/actions/runs/$run_id" >> "$GITHUB_OUTPUT"
- name: Create PR comment
# https://github.com/mshick/add-pr-comment
uses: mshick/add-pr-comment@v3.9.1
with:
# We use `GITHUB_TOKEN` here so there is no chance that we'll trigger another run of this workflow.
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
repo-token: ${{ secrets.GITHUB_TOKEN }}
message-id: "pr-${{ github.event.issue.number }}-${{ github.run_id }}"
message: |
Started a full build: ${{ steps.dispatch.outputs.workflow_run_url }}
+252
View File
@@ -0,0 +1,252 @@
# Jobs that only run for developers on the `rerun` team.
# We have to ensure that these jobs _only_ run for PRs inside the `rerun-io` organization
# this is done using the following check, added to every job:
# if: github.event.pull_request.head.repo.owner.login == 'rerun-io'
# (unfortunately this does not work on the trigger or the entire `jobs` category)
name: Pull-Request
on:
pull_request:
types:
- opened
- synchronize
permissions: write-all
# These jobs use fairly short names as they are a prefix in the display hierarchy
jobs:
checks:
name: Checks
if: github.event.pull_request.head.repo.owner.login == 'rerun-io'
uses: ./.github/workflows/reusable_checks.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
CHANNEL: pr
secrets: inherit
paths-filter:
if: github.event.pull_request.head.repo.owner.login == 'rerun-io'
runs-on: ubuntu-latest
outputs:
cpp_changes: ${{ steps.filter.outputs.cpp_changes }}
docs_changes: ${{ steps.filter.outputs.docs_changes }}
python_changes: ${{ steps.filter.outputs.python_changes }}
rust_changes: ${{ steps.filter.outputs.rust_changes }}
protobuf_changes: ${{ steps.filter.outputs.protobuf_changes }}
web_changes: ${{ steps.filter.outputs.web_changes }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
cpp_changes:
# - .github/**/*.yml - this is tempting, but leads to constant rebuilds
- crates/top/rerun_c/**/*
- pixi.lock # maybe our build commands have changed
- pixi.toml # maybe our build commands have changed
- scripts/ci/**/*
- '**/*.cpp'
- '**/*.hpp'
- '**/*cmake'
- '**/CMakeLists.txt'
docs_changes:
# - .github/**/*.yml - this is tempting, but leads to constant rebuilds
- .github/actions/vercel/**/*
- pixi.lock # maybe our build commands have changed
- pixi.toml # maybe our build commands have changed
- scripts/ci/*
- 'docs/content/**/*.md'
- 'examples/**/*.md'
- 'examples/manifest.toml'
python_changes:
# - .github/**/*.yml - this is tempting, but leads to constant rebuilds
- pixi.lock # maybe our build commands have changed
- pixi.toml # maybe our build commands have changed
- scripts/ci/*
- '**/*.py'
- '**/*.pyi'
- '**/requirements.txt'
- '**/pyproject.toml'
rust_changes:
# - .github/**/*.yml - this is tempting, but leads to constant rebuilds
- Cargo.lock
- crates/viewer/re_ui/data/**/* # parts of data are imported into the viewer and has ramifications on various tests
- pixi.lock # maybe our build commands have changed
- pixi.toml # maybe our build commands have changed
- "**/*.rs"
# wgsl is embedded into Rust binaries and should trigger tests.
- "rerun/**/*.wgsl"
- "**/*.toml"
- "crates/**/*.png"
- "tests/rust/**/*.png"
protobuf_changes:
# - .github/**/*.yml - this is tempting, but leads to constant rebuilds
- "**/**.proto"
- pixi.lock # maybe our build commands have changed
- pixi.toml # maybe our build commands have changed
- scripts/ci/*
- "**/*.toml"
web_changes:
# - .github/**/*.yml - this is tempting, but leads to constant rebuilds
- Cargo.lock
- pixi.lock # maybe our build commands have changed
- pixi.toml # maybe our build commands have changed
- scripts/ci/*
- "**/*.html"
- "**/*.js"
- "**/*.mjs"
- "**/*.json"
- "**/*.rs"
- "**/*.toml"
- "**/yarn.lock"
- "crates/viewer/re_ui/data/**"
protobuf-checks:
name: "Protobuf Checks"
needs: [paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && needs.paths-filter.outputs.protobuf_changes == 'true'
uses: ./.github/workflows/reusable_checks_protobuf.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
secrets: inherit
rust-checks:
name: "Rust Checks"
needs: [paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && needs.paths-filter.outputs.rust_changes == 'true'
uses: ./.github/workflows/reusable_checks_rust.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
CHANNEL: main # We run the full test suite here, because we've had so many breakages
secrets: inherit
python-checks:
name: "Python Checks"
needs: [paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && needs.paths-filter.outputs.python_changes == 'true'
uses: ./.github/workflows/reusable_checks_python.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
secrets: inherit
cpp-tests:
name: "C++ tests"
needs: [paths-filter]
if: needs.paths-filter.outputs.cpp_changes == 'true'
uses: ./.github/workflows/reusable_checks_cpp.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
CHANNEL: pr
secrets: inherit
cli-build:
name: "Rerun CLI Build"
needs: [paths-filter]
if: needs.paths-filter.outputs.python_changes == 'true' || needs.paths-filter.outputs.rust_changes == 'true'
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
PLATFORM: linux-x64
secrets: inherit
# Build and test a single wheel to limit CI cost. We use linux-x64 because it's fast. linux-arm64 would also be a good
# choice, but reusable_test_wheels.yml is broken for that target (https://github.com/rerun-io/rerun/issues/5525)
min-wheel-build:
name: "Minimum Wheel Build"
needs: [cli-build, paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && (needs.paths-filter.outputs.python_changes == 'true' || needs.paths-filter.outputs.rust_changes == 'true')
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
MODE: "pr"
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: "linux-x64-wheel-fast"
secrets: inherit
min-wheel-test:
name: "Minimum Wheel Test"
needs: [min-wheel-build, paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && (needs.paths-filter.outputs.python_changes == 'true' || needs.paths-filter.outputs.rust_changes == 'true')
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: "linux-x64-wheel-fast"
FAST: true
secrets: inherit
build-js:
name: "Build rerun_js"
needs: [paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && needs.paths-filter.outputs.web_changes == 'true'
uses: ./.github/workflows/reusable_build_js.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
secrets: inherit
build-web:
name: "Build web viewer"
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && needs.paths-filter.outputs.web_changes == 'true'
needs: [paths-filter]
uses: ./.github/workflows/reusable_build_web.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
CHANNEL: main
secrets: inherit
web-test:
name: "Web tests"
needs: [paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && needs.paths-filter.outputs.web_changes == 'true'
uses: ./.github/workflows/reusable_web_test.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
secrets: inherit
upload-web:
name: "Upload Web"
needs: [build-web]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io'
uses: ./.github/workflows/reusable_upload_web.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
PR_NUMBER: ${{ github.event.pull_request.number }}
secrets: inherit
upload-js:
name: "Upload JS"
needs: [build-js]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io'
uses: ./.github/workflows/reusable_upload_js.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
PR_NUMBER: ${{ github.event.pull_request.number }}
secrets: inherit
deploy-landing-preview:
name: "Deploy Landing Preview"
needs: [paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && needs.paths-filter.outputs.docs_changes == 'true'
uses: ./.github/workflows/reusable_deploy_landing_preview.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
PR_NUMBER: ${{ github.event.pull_request.number }}
secrets: inherit
check-doc-redirects:
name: "Check Doc Redirects"
needs: [paths-filter]
if: github.event.pull_request.head.repo.owner.login == 'rerun-io' && needs.paths-filter.outputs.docs_changes == 'true'
uses: ./.github/workflows/reusable_checks_doc_redirects.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
secrets: inherit
@@ -0,0 +1,42 @@
# Jobs that only run for external contributors.
# These have to be carefully sanitized, we don't want to leak secrets.
# - We can't use caching, outside of really rare scenarios, because our caching largely depends on GCS
# - We have to ensure that these jobs _only_ run for PRs outside of the `rerun-io` organization
# this is done using the following check, added to every job:
# if: github.event.pull_request.head.repo.owner.login != 'rerun-io'
name: Pull-Request (Contrib)
on:
pull_request:
types:
- opened
- synchronize
permissions:
contents: "read"
packages: "read"
jobs:
checks:
name: "Checks"
if: github.event.pull_request.head.repo.owner.login != 'rerun-io'
uses: ./.github/workflows/contrib_checks.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
PR_NUMBER: ${{ github.event.pull_request.number }}
python:
name: "Python"
if: github.event.pull_request.head.repo.owner.login != 'rerun-io'
uses: ./.github/workflows/contrib_rerun_py.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
MATURIN_FEATURE_FLAGS: "--no-default-features --features extension-module"
check-doc-redirects:
name: "Check Doc Redirects"
if: github.event.pull_request.head.repo.owner.login != 'rerun-io'
uses: ./.github/workflows/reusable_checks_doc_redirects.yml
with:
CONCURRENCY: pr-${{ github.event.pull_request.number }}
+98
View File
@@ -0,0 +1,98 @@
name: "Push Docs"
on:
push:
branches: [docs-latest]
concurrency:
group: on-push-docs
cancel-in-progress: true
permissions:
contents: "read"
id-token: "write"
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
jobs:
# Get latest release version from crates.io
# This excludes any prerelease builds, e.g. `0.15.0-alpha.1` or `rc` or similar.
# We get it from crates.io because it's the strongest indicator of the latest
# fully released version we have available, and there is no better way to retrieve
# that in the context of this branch, because we don't want to rely on the contents
# of a local `Cargo.toml` or the git branch name.
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.versioning.outputs.crate_version }}
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Get version
id: versioning
run: |
crate_version=$(pixi run python scripts/ci/crates.py get-version --from=cratesio --skip-prerelease)
echo "crate_version=$crate_version" >> "$GITHUB_OUTPUT"
build-search-index:
runs-on: ubuntu-latest-16-cores
needs: [get-version]
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-linux"
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Build search index
run: |
pixi run search-index build \
landing \
--url "https://ms-b22605aed932-7275.fra.meilisearch.io" \
--master-key "${{ secrets.MEILISEARCH_TOKEN }}" \
--release-version "${{ needs.get-version.outputs.version }}"
# The website reads prose from GCS at SSR time, so a `docs-latest`
# push takes effect via a GCS re-upload + ISR revalidate.
upload-prose:
name: Upload prose to GCS
runs-on: ubuntu-latest
needs: [get-version]
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Upload markdown docs & examples to GCS"
env:
ISR_BYPASS_TOKEN: ${{ secrets.ISR_BYPASS_TOKEN }}
VERSION_LABEL: ${{ needs.get-version.outputs.version }}
RERUN_COMMIT: ${{ github.sha }}
run: |
pixi run uv run scripts/ci/upload_docs.py upload \
--version "$VERSION_LABEL" \
--rerun-commit "$RERUN_COMMIT" \
--mark-latest \
--purge-token "$ISR_BYPASS_TOKEN"
+265
View File
@@ -0,0 +1,265 @@
name: Push To Main
on:
push:
branches:
- "main"
# Can be triggered manually from within the UI or using the GH CLI,
# e.g. `gh workflow run on_push_main.yml --ref main`
workflow_dispatch:
inputs:
CONCURRENCY:
required: true
type: string
permissions: write-all
jobs:
checks:
name: Checks
uses: ./.github/workflows/reusable_checks.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
CHANNEL: main
secrets: inherit
cpp_checks:
name: Checks
uses: ./.github/workflows/reusable_checks_cpp.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
CHANNEL: main
secrets: inherit
rust_checks:
name: Checks
uses: ./.github/workflows/reusable_checks_rust.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
CHANNEL: main
secrets: inherit
python_checks:
name: Checks
uses: ./.github/workflows/reusable_checks_python.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
secrets: inherit
deploy-docs:
needs: [checks]
name: Deploy Docs
uses: ./.github/workflows/reusable_deploy_docs.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PY_DOCS_VERSION_NAME: "main"
CPP_DOCS_VERSION_NAME: "main"
JS_DOCS_VERSION_NAME: "main"
MARKDOWN_DOCS_VERSION_NAME: "dev"
UPDATE_LATEST: false
secrets: inherit
build-web:
name: "Build web viewer"
uses: ./.github/workflows/reusable_build_web.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
CHANNEL: main
secrets: inherit
web-test:
name: "Web tests"
uses: ./.github/workflows/reusable_web_test.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
secrets: inherit
upload-web:
name: "Upload Web"
needs: [build-web]
uses: ./.github/workflows/reusable_upload_web.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
secrets: inherit
build-js:
name: "Build JS"
uses: ./.github/workflows/reusable_build_js.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
secrets: inherit
upload-js:
name: "Upload JS"
needs: [build-js]
uses: ./.github/workflows/reusable_upload_js.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
secrets: inherit
build-examples:
name: "Build Examples"
needs: [build-wheel-linux-x64]
uses: ./.github/workflows/reusable_build_examples.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
CHANNEL: main
WHEEL_ARTIFACT_NAME: linux-x64-wheel
secrets: inherit
track-sizes:
name: "Track Sizes"
needs: [build-web, build-examples]
uses: ./.github/workflows/reusable_track_size.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
WITH_EXAMPLES: true
secrets: inherit
upload-examples:
name: "Upload Examples"
needs: [build-examples]
uses: ./.github/workflows/reusable_upload_examples.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
secrets: inherit
# -----------------------------------------------------------------------------------
# Build rerun_c library binaries:
build-rerun_c-and-upload-linux-arm64:
needs: [checks]
name: "Linux-Arm64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: push-linux-arm64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: linux-arm64
secrets: inherit
build-rerun_c-and-upload-linux-x64:
needs: [checks]
name: "Linux-x64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: push-linux-x64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: linux-x64
secrets: inherit
build-rerun_c-and-upload-macos-arm64:
needs: [checks]
name: "Mac-Arm64: Build & Upload rerun_c"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: push-macos-arm64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: macos-arm64
secrets: inherit
# -----------------------------------------------------------------------------------
# Build rerun-cli (rerun binaries):
build-rerun-cli-and-upload-linux-arm64:
needs: [checks]
name: "Linux-arm64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: push-linux-arm64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: linux-arm64
secrets: inherit
build-rerun-cli-and-upload-linux-x64:
needs: [checks]
name: "Linux-x64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: push-linux-x64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: linux-x64
secrets: inherit
build-rerun-cli-and-upload-macos-arm64:
needs: [checks]
name: "Mac-arm64: Build & Upload rerun-cli"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: push-macos-arm64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: macos-arm64
secrets: inherit
# ---------------------------------------------------------------------------
# Build wheels:
build-wheel-linux-arm64:
needs: [checks, build-rerun-cli-and-upload-linux-arm64]
name: "Linux-arm64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: push-linux-arm64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: linux-arm64
WHEEL_ARTIFACT_NAME: linux-arm64-wheel
MODE: "pypi"
secrets: inherit
build-wheel-linux-x64:
needs: [checks, build-rerun-cli-and-upload-linux-x64]
name: "Linux-x64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: push-linux-x64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: linux-x64-wheel
MODE: "pypi"
secrets: inherit
build-wheel-macos-arm64:
needs: [checks, build-rerun-cli-and-upload-macos-arm64]
name: "Macos-arm64: Build & Upload Wheels"
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: push-macos-arm64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: macos-arm64
WHEEL_ARTIFACT_NAME: macos-arm64-wheel
MODE: "pypi"
secrets: inherit
# ---------------------------------------------------------------------------
# Test wheels:
test-wheel-linux-arm64:
needs: [checks, build-wheel-linux-arm64]
name: "linux-arm64: Test Wheels"
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: push-linux-arm64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: linux-arm64
WHEEL_ARTIFACT_NAME: linux-arm64-wheel
secrets: inherit
test-wheel-linux-x64:
needs: [checks, build-wheel-linux-x64]
name: "Linux-x64: Test Wheels"
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: push-linux-x64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: linux-x64-wheel
secrets: inherit
test-wheel-macos-arm64:
needs: [checks, build-wheel-macos-arm64]
name: "macos-arm64: Test Wheels"
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: push-macos-arm64-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
PLATFORM: macos-arm64
WHEEL_ARTIFACT_NAME: macos-arm64-wheel
secrets: inherit
generate-pip-index:
name: "Generate Pip Index"
needs:
[build-wheel-linux-arm64, build-wheel-linux-x64, build-wheel-macos-arm64]
uses: ./.github/workflows/reusable_pip_index.yml
with:
CONCURRENCY: push-${{ github.ref_name }}-${{ inputs.CONCURRENCY }}
CHECK: false # we don't build wheels for all platforms on push-to-main
secrets: inherit
@@ -0,0 +1,190 @@
name: PR Trigger Reality Sync
on:
issue_comment:
types: [created]
pull_request_target:
types: [synchronize]
jobs:
# Post a helpful message when unauthorized users try to trigger sync
unauthorized-message:
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
(
contains(github.event.comment.body, '@rerun-bot reality-sync') ||
contains(github.event.comment.body, '@rerun-bot sync-reality')
) &&
github.event.comment.user.type != 'Bot' &&
github.event.comment.author_association != 'OWNER' &&
github.event.comment.author_association != 'MEMBER'
runs-on: ubuntu-latest
steps:
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.SYNC_APP_ID }}
private-key: ${{ secrets.SYNC_APP_PRIVATE_KEY }}
owner: rerun-io
repositories: rerun
- name: Post unauthorized message
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
gh pr comment ${{ github.event.issue.number }} \
--repo ${{ github.repository }} \
--body "Sorry, only organization members can trigger reality-sync."
trigger-import:
# For issue_comment: org members (OWNER/MEMBER) can trigger with '@rerun-bot reality-sync' or '@rerun-bot sync-reality'
# For pull_request_target: only auto-sync non-fork PRs (fork PRs require explicit comment trigger)
if: |
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
(
contains(github.event.comment.body, '@rerun-bot reality-sync') ||
contains(github.event.comment.body, '@rerun-bot sync-reality')
) &&
github.event.comment.user.type != 'Bot' &&
(
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER'
)
) || (
github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name == github.repository
)
runs-on: ubuntu-latest
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
steps:
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.SYNC_APP_ID }}
private-key: ${{ secrets.SYNC_APP_PRIVATE_KEY }}
owner: rerun-io
repositories: |
reality
rerun
- name: Acknowledge command (eyes reaction)
if: github.event_name == 'issue_comment'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
gh api -X POST \
/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
-f content=eyes
- name: Determine PR number
id: pr-info
run: |
if [ "${{ github.event_name }}" = "issue_comment" ]; then
echo "pr_number=${{ github.event.issue.number }}" >> $GITHUB_OUTPUT
echo "triggered_by=${{ github.event.comment.user.login }}" >> $GITHUB_OUTPUT
echo "trigger_type=comment" >> $GITHUB_OUTPUT
else
echo "pr_number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
echo "triggered_by=${{ github.event.sender.login }}" >> $GITHUB_OUTPUT
echo "trigger_type=push" >> $GITHUB_OUTPUT
fi
- name: Check for existing sync comment (push events only)
if: github.event_name == 'pull_request_target'
id: check-sync-comment
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
PR_NUMBER="${{ steps.pr-info.outputs.pr_number }}"
echo "Checking PR #${PR_NUMBER} for existing sync comment…"
# Look for "Sync complete" comment from the sync bot (GitHub App)
# Check performed_via_github_app.id matches our app to prevent spoofing
SYNC_APP_ID="${{ vars.SYNC_APP_ID }}"
SYNC_COMMENT=$(gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" \
| jq -r --arg app_id "$SYNC_APP_ID" '.[] | select((.performed_via_github_app.id | tostring == $app_id) and (.body | contains("Sync complete. Mirror PR in reality:"))) | .id' \
| head -1)
if [ -n "$SYNC_COMMENT" ]; then
echo "has_sync=true" >> $GITHUB_OUTPUT
echo "✓ Found existing sync comment, will re-sync on push"
else
echo "has_sync=false" >> $GITHUB_OUTPUT
echo "No existing sync comment found, skipping auto-sync"
fi
- name: Get PR details
if: |
github.event_name == 'issue_comment' ||
steps.check-sync-comment.outputs.has_sync == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
PR_NUMBER="${{ steps.pr-info.outputs.pr_number }}"
echo "Fetching PR details for PR #${PR_NUMBER}…"
gh pr view "$PR_NUMBER" \
--repo ${{ github.repository }} \
--json headRefName,headRepositoryOwner,headRepository,number,title,body,labels \
> /tmp/pr_data.json
echo "PR data:"
jq '.' /tmp/pr_data.json
- name: Trigger reality sync workflow
if: |
github.event_name == 'issue_comment' ||
steps.check-sync-comment.outputs.has_sync == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
echo "================================================"
echo "Triggering repository_dispatch to reality repo"
echo "Trigger type: ${{ steps.pr-info.outputs.trigger_type }}"
echo "================================================"
# Construct the entire payload using jq to avoid shell substitution
# This ensures backticks and other special characters in title/body are handled safely
jq -n \
--arg repo "${{ github.event.repository.name }}" \
--arg current_repo "${{ github.repository }}" \
--arg triggered_by "${{ steps.pr-info.outputs.triggered_by }}" \
--slurpfile pr_data /tmp/pr_data.json \
'{
event_type: "sync-import-pr",
client_payload: {
repo: $repo,
pr_number: $pr_data[0].number,
head_ref: $pr_data[0].headRefName,
head_owner: $pr_data[0].headRepositoryOwner.login,
head_repo: $pr_data[0].headRepository.name,
title: $pr_data[0].title,
body: ($pr_data[0].body // ""),
labels: $pr_data[0].labels,
is_fork: (("\($pr_data[0].headRepositoryOwner.login)/\($pr_data[0].headRepository.name)") != $current_repo),
triggered_by: $triggered_by
}
}' > /tmp/dispatch_payload.json
echo "Dispatch payload:"
jq '.' /tmp/dispatch_payload.json
# Make the API call with the JSON payload
if gh api repos/rerun-io/reality/dispatches --input /tmp/dispatch_payload.json 2>&1; then
echo "✓ Successfully dispatched sync-import-pr event to reality repo"
echo "Note: repository_dispatch returns 204 No Content on success"
echo "The reality repo should now be processing the import workflow"
else
echo "::error::Failed to dispatch repository_dispatch event to reality repo"
echo "::error::This could be due to:"
echo "::error:: 1. Insufficient permissions on the GitHub App token"
echo "::error:: 2. Reality repo not found or not accessible"
echo "::error:: 3. Network issues"
exit 1
fi
+590
View File
@@ -0,0 +1,590 @@
name: Release
run-name: Release (${{ inputs.release-type }})
on:
workflow_dispatch:
inputs:
release-type:
description: "What kind of release is this?"
type: choice
options:
- alpha
- rc
- final
required: true
publish-crates:
description: "Publish crates (ignored for non-alpha release)"
type: boolean
required: false
default: true
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
# wants to push commits and create a PR
permissions:
contents: write # Allow pushing commits
pull-requests: write # Allow creating PRs
packages: read # Allow reading packages
id-token: "write"
jobs:
# Re-entrancy:
# - `version` is re-entrant because it doesn't commit/create PR if the version doesn't change,
# and the version doesn't change if we're already on the final version specified by the branch name.
# - `update-docs` is re-entrant because it overwrites history of the `gh-pages` branch, so any
# previous partial update will just be overwritten by the next successful run.
# - `publish-crates` is re-entrant because the `crates.py` script correctly handles publish failures
# by first checking if a crate has already been published before attempting to publish it.
# - `build-and-publish-wheels` is re-entrant because all the uploaded artifacts will be overwritten
# by any subsequent runs, and the final upload to PyPI has the `--skip-existing` flag, which ignores
# any wheels already uploaded.
# - `build-and-publish-web` is re-entrant for the same reason as `build-and-publish-wheels`,
# except that uploads are done to GCS instead of PyPI.
checks:
timeout-minutes: 60
name: "Checks"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Check links for `?speculative-link`
# This checks that we have no links with `?speculative-link` in its query params.
# We use those markers to get our link checker to ignore links to unreleased docs.
#
# NOTE: For alpha releases, we won't fully publish all our docs,
# so we skip the check here, because we won't be able to
# remove the markers yet.
run: |
if [ ${{ inputs.release-type }} != "alpha" ]; then
python3 scripts/ci/check_speculative_links.py
fi
# NOTE: When updating this job, also remember to update `post-release-version-bump`.
version:
name: "Versioning"
runs-on: ubuntu-latest
outputs:
previous: ${{ steps.versioning.outputs.previous }}
current: ${{ steps.versioning.outputs.current }}
final: ${{ steps.versioning.outputs.final }}
git_tag: ${{ steps.versioning.outputs.git_tag }}
# will be set to `github.sha` if the pull request already exists
# this is the last (and not merge) commit in the release branch
release-commit: ${{ steps.commit.outputs.version_bump_commit_sha || github.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RERUN_BOT_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Update crate versions
id: versioning
run: |
echo Check that the release version matches expected format…
pixi run python scripts/ci/crates.py check-git-branch-name
echo Parse the release version from the branch name…
# `prepare-release-0.8.1-alpha.N` -> `0.8.1`
release_version=$(pixi run python scripts/ci/crates.py get-version --from git --finalize)
echo "release_version: $release_version"
echo Store version before the update, so we can later detect if it changed…
previous=$(pixi run python scripts/ci/crates.py get-version)
echo If the version minus prerelease/build metadata is not the same as the release version, then update it.…
if [ $(pixi run python scripts/ci/crates.py get-version --finalize) != $release_version ]; then
pixi run python scripts/ci/crates.py version --exact $release_version
fi
echo If this is an 'rc', additionally set add '-rc.N'. This will also bump the 'N' if '-rc.N' is already set…
if [ ${{ inputs.release-type }} = "rc" ]; then
pixi run python scripts/ci/crates.py version --bump prerelease --pre-id=rc
fi
echo If this is an 'alpha', set the version to whatever is in the git branch name.…
if [ ${{ inputs.release-type }} = "alpha" ]; then
pixi run python scripts/ci/crates.py version --exact $(pixi run python scripts/ci/crates.py get-version --from git)
fi
echo If this is a 'final', set the version to the final release version…
if [ ${{ inputs.release-type }} = "final" ]; then
pixi run python scripts/ci/crates.py version --exact $release_version
fi
echo Store version after the update, and the expected "final" release version…
current=$(pixi run python scripts/ci/crates.py get-version)
final=$(pixi run python scripts/ci/crates.py get-version --finalize)
echo Output everything for use in other steps…
echo "previous=$previous"
echo "current=$current"
echo "final=$final"
echo "previous=$previous" >> "$GITHUB_OUTPUT"
echo "current=$current" >> "$GITHUB_OUTPUT"
echo "final=$final" >> "$GITHUB_OUTPUT"
# Pick what version we use for creating a github tag.
if [ ${{ inputs.release-type }} = "final" ]; then
git_tag=$final
else
git_tag=$current
fi
# Verify that it wasn't created yet.
if [ $(git tag -l "$git_tag") ]; then
echo "Error: Version tag $git_tag already exists!"
exit 1
fi
echo "git_tag=$git_tag" >> "$GITHUB_OUTPUT"
- name: Update rerun_py & rerun_c version
run: |
pixi run python scripts/ci/update_rerun_py_and_c_version.py "${{ steps.versioning.outputs.current }}"
- name: Update rerun_notebook package version
run: |
pixi run python scripts/ci/update_rerun_notebook_version.py "${{ steps.versioning.outputs.current }}"
- name: Update JS package versions
run: |
pixi run node rerun_js/scripts/version.mjs "${{ steps.versioning.outputs.current }}"
- run: pixi run toml-fmt
# We must re-sync uv after bumping the version
- run: pixi run uv lock
- name: Commit new version
id: commit
if: steps.versioning.outputs.previous != steps.versioning.outputs.current
run: |
git pull
git config --global user.name "rerun-bot"
git config --global user.email "bot@rerun.io"
git commit -am "Bump versions to ${{ steps.versioning.outputs.current }}"
git push
echo "version_bump_commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Create pull request
env:
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
pr=$(gh pr view --json headRefName 2>/dev/null || echo "{}")
if echo "$pr" | jq -e '.headRefName' >/dev/null 2>&1; then
echo "PR already exists"
exit 0
fi
echo "PR does not exist, creating…"
cat <<'EOF' > pr-body.txt
### Next steps
- Test the release
- For alpha releases:
- [ ] If a GH release should be published for this alpha (give extra love to alphas deployed to Rerun Hub or when external testing is required):
- [ ] Create the GitHub release manually from the UI
- [ ] Stretch goal: generate a raw changelog and add it to the GH release with this disclaimer:
**DISCLAIMER**: This is an unreviewed, automatically generated changelog. We only provide fully reviewed changelogs for final releases.
- [ ] Merge or close the release PR
- **IFF** the release job succeeds and the link checker is happy, you may merge the PR.
- Otherwise, close the PR without merging. Cherrypick any interesting commit to `main`, but *not* the version bump one (it would introduce bad links).
- For non-alpha releases:
- For any added commits, run the release workflow in 'rc' mode again
- After testing, _ensure that this PR is mergeable to `main`_, then run the release workflow in 'final' mode
- Once the final release workflow finishes it will create a GitHub release for you. Then:
- [ ] Sanity check the build artifacts:
- [ ] pip install: does it install and run?
- [ ] cargo install of cli tool: does it install and run?
- [ ] C++ SDK zip: does it contain rerun_c for all platforms?
- [ ] Web Viewer: does it run and connect to Rerun Hub servers?
- [ ] Edit and publish the GitHub release:
- Do NOT create a GitHub release draft yourself! Let the release job do it.
- Populate the release with the changelog and a nice header video/picture
- Make sure `Set as latest release` is checked
- Click `Publish release`
- Once published, the release assets will sync to it automatically.
- [ ] Update the [google colab notebooks](https://colab.research.google.com/drive/1R9I7s4o6wydQC_zkybqaSRFTtlEaked_) to install this version and re-execute the notebook.
- [ ] Verify the auto-triggered [gradio-rerun-viewer release workflow](https://github.com/rerun-io/gradio-rerun-viewer/actions/workflows/auto_release_on_rerun.yml) succeeded (dispatched from `on_gh_release.yml` for final releases)
- [ ] Create a new branch from the prepare-release branch, rebase that one on main and sync it to reality so it can be merged.
- [ ] (A few hours later) Check on the [conda feedstock PR](https://github.com/conda-forge/rerun-sdk-feedstock/pulls) (ping Antoine and/or Nick if necessary)
- [ ] Tests
- [ ] Windows
- [ ] Linux
- [ ] MacOS
EOF
gh pr create \
--base main \
--head $(git branch --show-current) \
--title "Release ${{ (inputs.release-type == 'alpha' && steps.versioning.outputs.current) || steps.versioning.outputs.final }}" \
--label "⛴ release" \
--label "exclude from changelog" \
--fill \
--body-file pr-body.txt
uv-lock-check:
name: "Check uv.lock"
needs: [version]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.version.outputs.release-commit }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Check uv.lock is up-to-date
run: pixi run uv-lock-check
update-docs:
name: "Update Docs"
needs: [version, publish-web]
uses: ./.github/workflows/reusable_deploy_docs.yml
with:
CONCURRENCY: ${{ github.ref_name }}
PY_DOCS_VERSION_NAME: ${{ inputs.release-type == 'final' && needs.version.outputs.final || 'dev' }}
CPP_DOCS_VERSION_NAME: ${{ inputs.release-type == 'final' && 'stable' || 'dev' }}
JS_DOCS_VERSION_NAME: ${{ inputs.release-type == 'final' && needs.version.outputs.final || 'dev' }}
MARKDOWN_DOCS_VERSION_NAME: ${{ inputs.release-type == 'final' && needs.version.outputs.final || 'dev' }}
RELEASE_COMMIT: ${{ needs.version.outputs.release-commit }}
RELEASE_VERSION: ${{ needs.version.outputs.final }}
UPDATE_LATEST: ${{ inputs.release-type == 'final' }}
secrets: inherit
publish-crates:
name: "Publish Crates"
if: inputs.release-type != 'alpha' || inputs.publish-crates
needs: [version, uv-lock-check]
uses: ./.github/workflows/reusable_release_crates.yml
with:
CONCURRENCY: ${{ github.ref_name }}
RELEASE_COMMIT: ${{ needs.version.outputs.release-commit }}
secrets: inherit
publish-rerun_c:
name: "Build and Publish C/C++ SDKs"
needs: [version, uv-lock-check]
uses: ./.github/workflows/reusable_publish_rerun_c.yml
with:
release-version: ${{ needs.version.outputs.current }}
release-commit: ${{ needs.version.outputs.release-commit }}
concurrency: ${{ github.ref_name }}
secrets: inherit
publish-rerun-cli:
name: "Publish rerun-cli"
needs: [version, uv-lock-check]
uses: ./.github/workflows/reusable_publish_rerun_cli.yml
with:
release-version: ${{ needs.version.outputs.current }}
release-commit: ${{ needs.version.outputs.release-commit }}
concurrency: ${{ github.ref_name }}
secrets: inherit
publish-wheels:
name: "Build and Publish Wheels"
needs: [version, publish-rerun-cli]
uses: ./.github/workflows/reusable_publish_wheels.yml
with:
release-version: ${{ needs.version.outputs.current }}
concurrency: ${{ github.ref_name }}
release-commit: ${{ needs.version.outputs.release-commit }}
secrets: inherit
web-test:
name: "Web tests"
needs: [version]
uses: ./.github/workflows/reusable_web_test.yml
with:
CONCURRENCY: ${{ github.ref_name }}
REF: ${{ needs.version.outputs.release-commit }}
secrets: inherit
publish-web:
name: "Build and Publish Web"
needs: [version, publish-wheels, web-test]
uses: ./.github/workflows/reusable_publish_web.yml
with:
release-version: ${{ needs.version.outputs.current }}
release-commit: ${{ needs.version.outputs.release-commit }}
concurrency: ${{ github.ref_name }}
wheel-artifact-name: linux-x64-wheel
update-latest: ${{ inputs.release-type == 'final' }}
secrets: inherit
publish-js:
name: "Publish JS"
needs: [version, uv-lock-check]
uses: ./.github/workflows/reusable_publish_js.yml
with:
release-version: ${{ needs.version.outputs.current }}
release-commit: ${{ needs.version.outputs.release-commit }}
concurrency: ${{ github.ref_name }}
secrets: inherit
# Force-pushes `latest` and `docs-latest` to the contents of the release branch.
# The push to `docs-latest` also triggers a re-deploy of `rerun.io`.
update-latest-branch:
name: "Update Latest Branch"
if: inputs.release-type == 'final' && !cancelled() && !failure()
needs:
[
version,
update-docs,
publish-crates,
publish-wheels,
publish-web,
publish-rerun_c,
publish-rerun-cli,
publish-js,
]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RERUN_BOT_TOKEN }}
ref: ${{ needs.version.outputs.release-commit }}
- name: Update latest branch
run: |
git config --global user.name "rerun-bot"
git config --global user.email "bot@rerun.io"
git fetch
git checkout ${{ github.ref_name }}
git push --force origin refs/heads/${{ github.ref_name }}:refs/heads/latest
git push --force origin refs/heads/${{ github.ref_name }}:refs/heads/docs-latest
tag-release:
name: "Tag Release"
if: ${{ !cancelled() && !failure() }}
needs:
[
version,
update-docs,
publish-crates,
publish-wheels,
publish-web,
publish-rerun_c,
publish-rerun-cli,
publish-js,
]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RERUN_BOT_TOKEN }}
- name: Release tag
env:
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
version="${{ needs.version.outputs.git_tag }}"
commit="${{ needs.version.outputs.release-commit }}"
git tag $version $commit
git push origin $version
- name: Create GH release
if: inputs.release-type == 'rc' || inputs.release-type == 'final'
env:
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
version="${{ needs.version.outputs.git_tag }}"
commit="${{ needs.version.outputs.release-commit }}"
if [ ${{ inputs.release-type }} = "final" ]; then
pre_arg=""
else
pre_arg="--prerelease"
fi
gh release create $version --verify-tag --draft --title $version $pre_arg
- name: Create comment
if: inputs.release-type == 'rc' || inputs.release-type == 'final'
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
pr_number=$(gh pr view --json number | jq '.number')
version="${{ needs.version.outputs.final }}"
cat <<EOF > comment-body.txt
The GitHub release draft for $version can be found in the [release list](https://github.com/rerun-io/rerun/releases).
Add a description, changelog, and a nice header video/picture, then click 'Publish release'.
EOF
gh pr comment $pr_number --body-file comment-body.txt
# Bump versions to next minor+alpha after the release has finished,
# so that the release PR can be merged.
post-release-version-bump:
name: "Post-Release Version Bump"
# We don't need to bump versions for `rc` releases, because we don't merge those.
if: (inputs.release-type == 'alpha' || inputs.release-type == 'final') && !cancelled() && !failure()
needs:
[
version,
update-docs,
publish-crates,
publish-wheels,
publish-web,
publish-rerun_c,
publish-rerun-cli,
publish-js,
]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RERUN_BOT_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: git config
run: |
git config --global user.name "rerun-bot"
git config --global user.email "bot@rerun.io"
git checkout ${{ github.ref_name }}
git pull --rebase
- name: Update crate versions
id: crates
run: |
pixi run python scripts/ci/crates.py version --bump auto
version="$(pixi run python scripts/ci/crates.py get-version)"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Update rerun_notebook package version
run: |
pixi run python scripts/ci/update_rerun_notebook_version.py "${{ steps.crates.outputs.version }}"
- name: Update JS package versions
run: |
pixi run node rerun_js/scripts/version.mjs "${{ steps.crates.outputs.version }}"
- name: Update rerun_py & rerun_c version
run: |
pixi run python scripts/ci/update_rerun_py_and_c_version.py "${{ steps.crates.outputs.version }}"
- run: pixi run toml-fmt
# We must re-sync uv after bumping the version
- run: pixi run uv lock
- name: Commit new version
run: |
git commit -am "Bump versions to ${{ steps.crates.outputs.version }}"
git push
comment-artifact-links:
name: "Link to artifacts"
if: ${{ !cancelled() && !failure() }}
needs:
[
version,
update-docs,
publish-crates,
publish-wheels,
publish-web,
publish-rerun_c,
publish-rerun-cli,
publish-js,
]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RERUN_BOT_TOKEN }}
- name: Create comment
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }}
run: |
pr_number=$(gh pr view --json number | jq '.number')
echo "pr_number: $pr_number"
short_commit_hash=$(echo ${{ needs.version.outputs.release-commit }} | cut -c1-7)
if [ ${{ inputs.release-type }} = "final" ]; then
web_app_link="https://rerun.io/viewer/version/${{ needs.version.outputs.final }}"
rerun_io_docs_link="https://rerun.io/docs"
py_docs_link="https://ref.rerun.io/docs/python/${{ needs.version.outputs.final }}"
else
web_app_link="https://rerun.io/viewer/commit/$short_commit_hash"
rerun_io_docs_link="https://rerun.io/preview/$short_commit_hash/docs"
py_docs_link="https://ref.rerun.io/docs/python/dev"
fi
wheels_link="https://pypi.org/project/rerun-sdk/${{ needs.version.outputs.current }}"
crates_link="https://crates.io/crates/rerun/${{ needs.version.outputs.current }}"
npm_link="https://www.npmjs.com/package/@rerun-io/web-viewer/v/${{ needs.version.outputs.current }}"
rs_docs_link="https://docs.rs/rerun/${{ needs.version.outputs.current }}"
cpp_sdk_zip_link="https://build.rerun.io/commit/$short_commit_hash/rerun_cpp_sdk.zip"
pip_install="pip install rerun-sdk==${{ needs.version.outputs.current }}"
cargo_install="cargo install rerun-cli@${{ needs.version.outputs.current }} --locked"
npm_install="npm install @rerun-io/web-viewer@${{ needs.version.outputs.current }}"
cat <<EOF > comment-body.txt
Version ${{ needs.version.outputs.current }} published successfully.
| artifact | install |
| --------------------------------- | -------------- |
| [web app]($web_app_link) | |
| [wheels]($wheels_link) | $pip_install |
| [crates]($crates_link) | $cargo_install |
| [npm]($npm_link) | $npm_install |
| [docs]($rerun_io_docs_link) | |
| [py docs]($py_docs_link) | |
| [rs docs]($rs_docs_link) | |
| [cpp_sdk zip]($cpp_sdk_zip_link) | |
EOF
gh pr comment $pr_number --body-file comment-body.txt
+137
View File
@@ -0,0 +1,137 @@
name: Reusable Bench
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
SAVE_BENCHES:
required: false
type: boolean
default: false
BENCH_NAME:
required: false
type: string
default: ""
COMPARE_TO:
required: false
type: string
default: ""
concurrency:
group: ${{ inputs.CONCURRENCY }}-bench
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
# contents permission to update benchmark contents in gh-pages branch
contents: write
id-token: "write"
# deployments permission to deploy GitHub pages website
deployments: write
jobs:
# ---------------------------------------------------------------------------
rs-benchmarks:
name: Rust Criterion benchmarks
timeout-minutes: 60
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we need full history
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-linux"
# Cache will be produced by `reusable_checks/rs-lints`
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${{github.sha}} | cut -c1-7`" >> $GITHUB_ENV
- name: Run benchmark
# Use bash shell so we get pipefail behavior with tee
# Running under `pixi` so we get `nasm`
run: |
pixi run cargo bench \
--all-features \
-p re_entity_db \
-p re_log_encoding \
-p re_query \
-p re_tuid \
-p re_video \
-- --output-format=bencher | tee /tmp/${{ env.SHORT_SHA }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
# TODO(jleibs) make this whole thing a python script
- name: "Upload bench to GCS based on SHA"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: /tmp/${{ env.SHORT_SHA }}
destination: "rerun-builds/benches/"
process_gcloudignore: false
- name: Download comparison bench from GCS
if: ${{ inputs.COMPARE_TO != '' }}
run: |
mkdir /tmp/compare/
gsutil cp gs://rerun-builds/benches/${{inputs.COMPARE_TO}} /tmp/compare/${{ inputs.COMPARE_TO }}
- name: Install cargo-benchcmp
run: pixi run cargo install cargo-benchcmp
- name: Compare results with benchcmp
if: ${{ inputs.COMPARE_TO != '' }}
run: pixi run cargo benchcmp /tmp/compare/${{ inputs.COMPARE_TO }} /tmp/${{ env.SHORT_SHA }} > /tmp/bench_results.txt
- name: "Upload bench-results to GCS"
if: ${{ inputs.COMPARE_TO != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: /tmp/bench_results.txt
destination: "rerun-builds/commit/${{env.SHORT_SHA}}/"
process_gcloudignore: false
- name: "Copy bench to named file"
if: ${{ inputs.BENCH_NAME != '' }}
run: cp /tmp/${{ env.SHORT_SHA }} /tmp/${{ inputs.BENCH_NAME }}
# Don't upload the new named bench until the end in case the names are the same
- name: "Upload named bench to GCS"
if: ${{ inputs.BENCH_NAME != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: /tmp/${{ inputs.BENCH_NAME }}
destination: "rerun-builds/benches/"
process_gcloudignore: false
- name: Render benchmark result
if: github.ref == 'refs/heads/main'
run: |
pixi run python scripts/ci/render_bench.py crates \
--after $(date -d"30 days ago" +%Y-%m-%d) \
--output "gs://rerun-builds/graphs"
@@ -0,0 +1,172 @@
name: Reusable Rerun-c Build
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
PLATFORM:
required: true
type: string
ADHOC_NAME:
required: false
type: string
default: ""
RELEASE_COMMIT:
required: false
type: string
default: ""
workflow_dispatch:
inputs:
ADHOC_NAME:
required: false
type: string
description: "Name of the adhoc build, used for upload directory"
default: ""
PLATFORM:
type: choice
options:
- linux-arm64
- linux-x64
- windows-x64
- macos-arm64
description: "Platform to build for"
required: true
CONCURRENCY:
required: false
type: string
default: "adhoc"
description: "Concurrency group to use"
concurrency:
group: ${{ inputs.CONCURRENCY }}-build-rerun_c
cancel-in-progress: true
env:
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
packages: "read"
id-token: "write"
jobs:
set-config:
name: Set Config (${{ inputs.PLATFORM }})
runs-on: ubuntu-latest-16-cores
outputs:
RUNNER: ${{ steps.set-config.outputs.runner }}
TARGET: ${{ steps.set-config.outputs.target }}
CONTAINER: ${{ steps.set-config.outputs.container }}
LIB_NAME: ${{ steps.set-config.outputs.lib_name }}
steps:
- name: Set runner and target based on platform
id: set-config
run: |
case "${{ inputs.PLATFORM }}" in
linux-arm64)
runner="ubuntu-arm-16-core"
target="aarch64-unknown-linux-gnu"
container="'ghcr.io/rerun-io/ci_docker:0.18.0'"
lib_name="librerun_c.a"
;;
linux-x64)
runner="ubuntu-latest-16-cores"
target="x86_64-unknown-linux-gnu"
container="'ghcr.io/rerun-io/ci_docker:0.18.0'"
lib_name="librerun_c.a"
;;
windows-x64)
runner="windows-latest-8-cores"
target="x86_64-pc-windows-msvc"
container="null"
lib_name="rerun_c.lib"
;;
macos-arm64)
runner="macos-26" # Small runners, because building rerun_c is fast
target="aarch64-apple-darwin"
container="null"
lib_name="librerun_c.a"
;;
*) echo "Invalid platform" && exit 1 ;;
esac
echo "runner=$runner" >> "$GITHUB_OUTPUT"
echo "target=$target" >> "$GITHUB_OUTPUT"
echo "container=$container" >> "$GITHUB_OUTPUT"
echo "lib_name=$lib_name" >> "$GITHUB_OUTPUT"
rs-build-rerun_c:
name: Build rerun_c (${{ needs.set-config.outputs.RUNNER }})
timeout-minutes: 60
needs: [set-config]
runs-on: ${{ needs.set-config.outputs.RUNNER }}
container:
image: ${{ fromJson(needs.set-config.outputs.CONTAINER) }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Show context
run: |
echo "GITHUB_CONTEXT": $GITHUB_CONTEXT
echo "JOB_CONTEXT": $JOB_CONTEXT
echo "INPUTS_CONTEXT": $INPUTS_CONTEXT
echo "ENV_CONTEXT": $ENV_CONTEXT
env:
ENV_CONTEXT: ${{ toJson(env) }}
GITHUB_CONTEXT: ${{ toJson(github) }}
JOB_CONTEXT: ${{ toJson(job) }}
INPUTS_CONTEXT: ${{ toJson(inputs) }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.ref) || '') }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Set up Rust and Authenticate to GCS
uses: ./.github/actions/setup-rust
with:
cache_key: "build-${{ inputs.PLATFORM }}"
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
targets: ${{ needs.set-config.outputs.TARGET }}
- name: Build rerun_c (release)
run: pixi run cargo build --locked -p rerun_c --release --target ${{ needs.set-config.outputs.TARGET }}
- name: Get sha
id: get-sha
run: |
full_commit="${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha) }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: "Upload rerun_c (commit)"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "./target/${{ needs.set-config.outputs.TARGET }}/release/${{ needs.set-config.outputs.LIB_NAME }}"
destination: "rerun-builds/commit/${{ steps.get-sha.outputs.sha }}/rerun_c/${{ inputs.PLATFORM }}"
parent: false
process_gcloudignore: false
- name: "Upload rerun_c (adhoc)"
if: ${{ inputs.ADHOC_NAME != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "./target/${{ needs.set-config.outputs.TARGET }}/release/${{ needs.set-config.outputs.LIB_NAME }}"
destination: "rerun-builds/adhoc/${{inputs.ADHOC_NAME}}/rerun_c/${{ inputs.PLATFORM }}"
parent: false
process_gcloudignore: false
@@ -0,0 +1,232 @@
name: Reusable Rerun CLI build & upload
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
PLATFORM:
required: true
type: string
ADHOC_NAME:
required: false
type: string
default: ""
RELEASE_COMMIT:
required: false
type: string
default: ""
workflow_dispatch:
inputs:
ADHOC_NAME:
required: false
type: string
default: ""
description: "Name of the adhoc build, used for upload directory"
PLATFORM:
type: choice
options:
- linux-arm64
- linux-x64
- windows-x64
- macos-arm64
description: "Platform to build for"
required: true
CONCURRENCY:
required: false
type: string
default: "adhoc"
description: "Concurrency group to use"
concurrency:
group: ${{ inputs.CONCURRENCY }}-build-rerun-cli
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
packages: "read"
id-token: "write"
jobs:
set-config:
name: Set Config (${{ inputs.PLATFORM }})
runs-on: ubuntu-latest
outputs:
RUNNER: ${{ steps.set-config.outputs.runner }}
TARGET: ${{ steps.set-config.outputs.target }}
CONTAINER: ${{ steps.set-config.outputs.container }}
BIN_NAME: ${{ steps.set-config.outputs.bin_name }}
steps:
- name: Set runner and target based on platform
id: set-config
run: |
case "${{ inputs.PLATFORM }}" in
linux-arm64)
runner="ubuntu-arm-16-core"
target="aarch64-unknown-linux-gnu"
container="'ghcr.io/rerun-io/ci_docker:0.18.0'"
bin_name="rerun"
;;
linux-x64)
runner="ubuntu-latest-16-cores"
target="x86_64-unknown-linux-gnu"
container="'ghcr.io/rerun-io/ci_docker:0.18.0'"
bin_name="rerun"
;;
windows-x64)
runner="windows-latest-16-cores"
target="x86_64-pc-windows-msvc"
container="null"
bin_name="rerun.exe"
;;
macos-arm64)
runner="macos-26-xlarge" # See https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/
target="aarch64-apple-darwin"
container="null"
bin_name="rerun"
;;
*) echo "Invalid platform" && exit 1 ;;
esac
echo "runner=$runner" >> "$GITHUB_OUTPUT"
echo "target=$target" >> "$GITHUB_OUTPUT"
echo "container=$container" >> "$GITHUB_OUTPUT"
echo "bin_name=$bin_name" >> "$GITHUB_OUTPUT"
build-rerun-cli:
name: Build rerun-cli (${{ needs.set-config.outputs.RUNNER }})
timeout-minutes: 60
needs: [set-config]
runs-on: ${{ needs.set-config.outputs.RUNNER }}
container:
image: ${{ fromJson(needs.set-config.outputs.CONTAINER) }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Show context
run: |
echo "GITHUB_CONTEXT": $GITHUB_CONTEXT
echo "JOB_CONTEXT": $JOB_CONTEXT
echo "INPUTS_CONTEXT": $INPUTS_CONTEXT
echo "ENV_CONTEXT": $ENV_CONTEXT
env:
ENV_CONTEXT: ${{ toJson(env) }}
GITHUB_CONTEXT: ${{ toJson(github) }}
JOB_CONTEXT: ${{ toJson(job) }}
INPUTS_CONTEXT: ${{ toJson(inputs) }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.ref) || '') }}
- name: Set up Rust and Authenticate to GCS
uses: ./.github/actions/setup-rust
with:
cache_key: "build-${{ inputs.PLATFORM }}"
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
targets: ${{ needs.set-config.outputs.TARGET }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Build web-viewer (release)
run: pixi run rerun-build-web-release
# This does not run in the pixi environment, doing so
# causes it to select the wrong compiler on macos-arm64
- name: Build rerun-cli
run: |
pixi run cargo build \
--locked \
-p rerun-cli \
--no-default-features \
--features release_full \
--release \
--target ${{ needs.set-config.outputs.TARGET }}
# Now that we already have a CLI binary, we can use it to check whether our man page is up to date.
- name: Compare man page to CLI docs
if: runner.os == 'Linux'
run: |
pixi run ./scripts/ci/check_cli_docs.py --rerun-exe "./target/${{ needs.set-config.outputs.TARGET }}/release/${{ needs.set-config.outputs.BIN_NAME }}"
- name: Get sha
id: get-sha
run: |
full_commit="${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha) }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
# Wrap the macOS binary in a Rerun.app bundle so macOS uses "Rerun" as the
# dock label / "About" name instead of falling back to the binary filename.
- name: Bundle Rerun.app (macOS)
if: inputs.PLATFORM == 'macos-arm64'
run: |
version=$(pixi run python scripts/ci/crates.py get-version)
mkdir -p bundle-out
pixi run python scripts/ci/bundle_macos_app.py \
--binary "./target/${{ needs.set-config.outputs.TARGET }}/release/${{ needs.set-config.outputs.BIN_NAME }}" \
--icon crates/viewer/re_viewer/data/app_icon_mac.png \
--info-plist scripts/ci/macos/Info.plist \
--version "$version" \
--output-dir bundle-out
tar -czf bundle-out/Rerun.app.tar.gz -C bundle-out Rerun.app
- name: "Upload rerun-cli (commit)"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "./target/${{ needs.set-config.outputs.TARGET }}/release/${{ needs.set-config.outputs.BIN_NAME }}"
destination: "rerun-builds/commit/${{ steps.get-sha.outputs.sha }}/rerun-cli/${{ inputs.PLATFORM }}"
parent: false
process_gcloudignore: false
- name: "Upload Rerun.app (commit, macOS)"
if: inputs.PLATFORM == 'macos-arm64'
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "bundle-out/Rerun.app.tar.gz"
destination: "rerun-builds/commit/${{ steps.get-sha.outputs.sha }}/rerun-cli/${{ inputs.PLATFORM }}"
parent: false
process_gcloudignore: false
# The tarball is already gzip-compressed. Uploading with the action's default
# `gzip: true` sets `Content-Encoding: gzip` on the blob, so the download client
# transparently decompresses one layer while validating the checksum against the
# still-compressed stored hash — a guaranteed checksum mismatch.
gzip: false
- name: "Upload rerun-cli (adhoc)"
if: ${{ inputs.ADHOC_NAME != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "./target/${{ needs.set-config.outputs.TARGET }}/release/${{ needs.set-config.outputs.BIN_NAME }}"
destination: "rerun-builds/adhoc/${{inputs.ADHOC_NAME}}/rerun-cli/${{ inputs.PLATFORM }}"
parent: false
process_gcloudignore: false
- name: "Upload Rerun.app (adhoc, macOS)"
if: ${{ inputs.ADHOC_NAME != '' && inputs.PLATFORM == 'macos-arm64' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "bundle-out/Rerun.app.tar.gz"
destination: "rerun-builds/adhoc/${{inputs.ADHOC_NAME}}/rerun-cli/${{ inputs.PLATFORM }}"
parent: false
process_gcloudignore: false
# See the note on the commit upload above: keep the already-gzipped tarball raw.
gzip: false
@@ -0,0 +1,238 @@
name: Reusable Build Wheels
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
MODE:
description: "The build mode, either `pypi` or `pr`"
required: true
type: string
PLATFORM:
required: true
type: string
WHEEL_ARTIFACT_NAME:
required: false
type: string
default: ""
RELEASE_COMMIT:
required: false
type: string
default: ""
workflow_dispatch:
inputs:
PLATFORM:
type: choice
options:
- linux-arm64
- linux-x64
- windows-x64
- macos-arm64
description: "Platform to build for"
required: true
MODE:
type: choice
required: false
options:
- pypi
- pr
- extra
description: "The build mode (`pypi` includes the web viewer, `pr` does not)"
CONCURRENCY:
required: false
type: string
default: "adhoc"
description: "Concurrency group to use"
WHEEL_ARTIFACT_NAME:
required: false
type: string
default: ""
description: "If set, will be saved under that name in the workflow artifacts"
RELEASE_COMMIT:
required: false
type: string
default: ""
description: "Release commit"
concurrency:
group: ${{ inputs.CONCURRENCY }}-build-wheels
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
packages: "read"
jobs:
# ---------------------------------------------------------------------------
set-config:
name: Set Config (${{ inputs.PLATFORM }})
runs-on: ubuntu-latest
outputs:
RUNNER: ${{ steps.set-config.outputs.runner }}
TARGET: ${{ steps.set-config.outputs.target }}
CONTAINER: ${{ steps.set-config.outputs.container }}
COMPAT: ${{ steps.set-config.outputs.compat }}
steps:
- name: Login to GHCR (with retries)
uses: nick-fields/retry@v3
with:
timeout_seconds: 10
max_attempts: 12
retry_on: timeout
warning_on_retry: true
command: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Set runner and target based on platform
id: set-config
run: |
case "${{ inputs.PLATFORM }}" in
linux-arm64)
runner="ubuntu-arm-16-core"
target="aarch64-unknown-linux-gnu"
container="'ghcr.io/rerun-io/ci_docker:0.18.0'" # Required to be manylinux compatible
compat="manylinux_2_28"
;;
linux-x64)
runner="ubuntu-latest-16-cores"
target="x86_64-unknown-linux-gnu"
compat="manylinux_2_28"
container="'ghcr.io/rerun-io/ci_docker:0.18.0'" # Required to be manylinux compatible
;;
windows-x64)
runner="windows-latest-32-cores"
target="x86_64-pc-windows-msvc"
container="null"
compat="manylinux_2_28"
;;
macos-arm64)
runner="macos-26-xlarge" # See https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/
target="aarch64-apple-darwin"
container="null"
compat="manylinux_2_28"
;;
*) echo "Invalid platform" && exit 1 ;;
esac
echo "runner=$runner" >> "$GITHUB_OUTPUT"
echo "target=$target" >> "$GITHUB_OUTPUT"
echo "container=$container" >> "$GITHUB_OUTPUT"
echo "compat=$compat" >> "$GITHUB_OUTPUT"
# ---------------------------------------------------------------------------
build-wheels:
name: Build Wheels (${{ needs.set-config.outputs.RUNNER }})
timeout-minutes: 60
needs: [set-config]
runs-on: ${{ needs.set-config.outputs.RUNNER }}
container:
image: ${{ fromJson(needs.set-config.outputs.CONTAINER) }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Show context
run: |
echo "GITHUB_CONTEXT": $GITHUB_CONTEXT
echo "JOB_CONTEXT": $JOB_CONTEXT
echo "INPUTS_CONTEXT": $INPUTS_CONTEXT
echo "ENV_CONTEXT": $ENV_CONTEXT
env:
ENV_CONTEXT: ${{ toJson(env) }}
GITHUB_CONTEXT: ${{ toJson(github) }}
JOB_CONTEXT: ${{ toJson(job) }}
INPUTS_CONTEXT: ${{ toJson(inputs) }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.ref) || '') }}
- name: Set up Rust and Authenticate to GCS
uses: ./.github/actions/setup-rust
with:
cache_key: "build-${{ inputs.PLATFORM }}"
# Cache will be produced by `reusable_checks/rs-lints`
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
targets: ${{ needs.set-config.outputs.TARGET }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Get sha
id: get-sha
run: |
full_commit="${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha) }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: "Download rerun-cli"
run: |
if [ "${{ inputs.PLATFORM }}" = "macos-arm64" ]; then
# macOS gets the Rerun.app bundle so the dock label reads "Rerun"
# (see scripts/ci/bundle_macos_app.py).
pixi run fetch-artifact \
--commit-sha ${{ steps.get-sha.outputs.sha }} \
--artifact rerun-cli-macos-app \
--platform ${{ inputs.PLATFORM }} \
--dest rerun_py/rerun_sdk/rerun_cli
else
pixi run fetch-artifact \
--commit-sha ${{ steps.get-sha.outputs.sha }} \
--artifact rerun-cli \
--platform ${{ inputs.PLATFORM }} \
--dest rerun_py/rerun_sdk/rerun_cli
fi
- name: Build
run: |
pixi run uvpy scripts/ci/build_and_upload_wheels.py \
--mode ${{ inputs.MODE }} \
--target ${{ needs.set-config.outputs.TARGET }} \
--dir commit/${{ steps.get-sha.outputs.sha }}/wheels \
--compat ${{ needs.set-config.outputs.COMPAT }} \
--upload-gcs
- name: Save wheel artifact
if: ${{ inputs.WHEEL_ARTIFACT_NAME != '' }}
uses: actions/upload-artifact@v4
with:
name: ${{inputs.WHEEL_ARTIFACT_NAME}}
path: dist/${{ needs.set-config.outputs.TARGET }}
# ---------------------------------------------------------------------------
# rerun_notebook support
- name: "Build rerun_notebook"
# only build the notebook if we are building for pypi and running linux-x64
if: ${{ (inputs.MODE == 'pypi' || inputs.MODE == 'extra') && inputs.PLATFORM == 'linux-x64' }}
run: |
rm -rf dist
pixi run js-build-base
pixi run uvpy scripts/ci/build_and_upload_rerun_notebook.py \
--dir commit/${{ steps.get-sha.outputs.sha }}/wheels \
--notebook-dir commit/${{ steps.get-sha.outputs.sha }}/notebook
- name: Save rerun_notebook wheel artifact
if: ${{ (inputs.MODE == 'pypi' || inputs.MODE == 'extra') && inputs.PLATFORM == 'linux-x64' }}
uses: actions/upload-artifact@v4
with:
name: rerun_notebook_wheel
path: dist
@@ -0,0 +1,104 @@
name: Reusable Build Examples
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
WHEEL_ARTIFACT_NAME:
required: true
type: string
CHANNEL: # `nightly`/`main`/`pr`
required: true
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-build-examples
cancel-in-progress: true
env:
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
rs-build-examples:
name: Build Examples
timeout-minutes: 60
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
with:
ref: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.ref) || '' }}
lfs: true
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-web"
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Download Rerun Wheel
uses: actions/download-artifact@v4
with:
name: ${{ inputs.WHEEL_ARTIFACT_NAME }}
path: wheel
- name: Download Rerun Notebook Wheel
uses: actions/download-artifact@v4
with:
name: rerun_notebook_wheel
path: wheel
- name: Install built wheel
run: |
pixi run python scripts/ci/uv_install_wheel.py --package rerun-sdk --dir wheel
pixi run python scripts/ci/uv_install_wheel.py --package rerun-notebook --dir wheel --platform-independent
- name: Print wheel version
run: |
pixi run uv pip show rerun-sdk
pixi run uv pip show rerun-notebook
pixi run uvpy -m rerun --version
- name: Get sha
id: get-sha
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: Build examples
run: |
pixi run build-examples rrd --install \
--channel ${{ inputs.CHANNEL }} \
example_data
- name: Build notebooks
run: |
pixi run build-examples notebook \
--channel ${{ inputs.CHANNEL }}
- name: Build & run snippets
run: |
pixi run build-examples snippets \
example_data/snippets
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: example_data
path: example_data
+73
View File
@@ -0,0 +1,73 @@
name: Reusable Build rerun_js
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-build-js
cancel-in-progress: true
env:
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
build:
name: Build rerun_js
timeout-minutes: 60
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: Install Yarn
run: npm install -g yarn
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-web"
# Cache will be produced by `reusable_checks/rs-check-wasm`
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Install yarn dependencies
run: pixi run yarn --cwd rerun_js install
- name: Build rerun_js package
run: pixi run yarn --cwd rerun_js workspaces run build
- name: Package rerun_js
run: |
pixi run yarn --cwd rerun_js workspaces run pack
mkdir rerun_js_package
cp rerun_js/*/*.tar.gz rerun_js_package/
- name: Upload rerun_js
uses: actions/upload-artifact@v4
with:
name: rerun_js
path: rerun_js_package
compression-level: 0 # already compressed
+126
View File
@@ -0,0 +1,126 @@
name: Reusable Build web viewer
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
RELEASE_VERSION:
required: false
type: string
default: "prerelease"
CHANNEL: # `nightly` or `main`
required: true
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-build-web
cancel-in-progress: true
env:
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
jobs:
rs-build-web-viewer:
name: Build web viewer
timeout-minutes: 60
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- name: Get sha
id: get-sha
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: Status comment
if: github.event_name == 'pull_request'
# https://github.com/mshick/add-pr-comment
uses: mshick/add-pr-comment@v3.9.1
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
with:
message-id: "web-viewer-build-status"
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
Web viewer is being built.
| Result | Commit | Link | Manifest |
| ------ | ------- | ----- | -------- |
| ⏳ | ${{ steps.get-sha.outputs.sha }} | https://rerun.io/viewer/pr/${{ github.event.pull_request.number }} | [`+nightly`](https://rerun.io/viewer/pr/${{ github.event.pull_request.number }}?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) [`+main`](https://rerun.io/viewer/pr/${{ github.event.pull_request.number }}?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) |
View image diff on [kitdiff](https://rerun-io.github.io/kitdiff/?url=${{github.event.pull_request.html_url}}).
<sup>Note: This comment is updated whenever you push a commit.</sup>
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-web"
# Cache will be produced by `reusable_checks/rs-check-wasm`
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Build web-viewer (release)
run: |
if [ ${{ inputs.CHANNEL }} = "nightly" ]; then
export DEFAULT_EXAMPLES_MANIFEST_URL="https://app.rerun.io/version/nightly/examples_manifest.json"
fi
pixi run rerun-build-web-release
# We build a single manifest pointing to the `commit`
# All the `pr`, `main`, release tag, etc. variants will always just point to the resolved commit
- name: Build examples manifest
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
sha="$(echo $full_commit | cut -c1-7)"
pixi run build-examples manifest \
--base-url "https://app.rerun.io/commit/$sha" \
--channel "${{ inputs.CHANNEL }}" \
"crates/viewer/re_web_viewer_server/web_viewer/examples_manifest.json"
- name: Upload web viewer
uses: actions/upload-artifact@v4
with:
name: web_viewer
path: "crates/viewer/re_web_viewer_server/web_viewer"
- name: Status comment
if: failure() && github.event_name == 'pull_request'
# https://github.com/mshick/add-pr-comment
uses: mshick/add-pr-comment@v3.9.1
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
with:
message-id: "web-viewer-build-status"
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
Web viewer failed to build.
| Result | Commit | Link | Manifest |
| ------ | ------- | ----- | -------- |
| ❌ | ${{ steps.get-sha.outputs.sha }} | https://rerun.io/viewer/pr/${{ github.event.pull_request.number }} | [`+nightly`](https://rerun.io/viewer/pr/${{ github.event.pull_request.number }}?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) [`+main`](https://rerun.io/viewer/pr/${{ github.event.pull_request.number }}?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) |
View image diff on [kitdiff](https://rerun-io.github.io/kitdiff/?url=${{github.event.pull_request.html_url}}).
<sup>Note: This comment is updated whenever you push a commit.</sup>
@@ -0,0 +1,61 @@
name: Reusable C++ bundling and upload
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
PLATFORM_FILTER:
required: false
type: string
RELEASE_COMMIT:
required: false
type: string
default: ""
concurrency:
group: ${{ inputs.CONCURRENCY }}-bundle-and-upload-rerun-cpp
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
bundle-and-upload-rerun_cpp:
name: Bundle and upload rerun_cpp_sdk.zip
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.ref) || '') }}
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Install python gcs library
run: |
pip3 install google-cloud-storage
- name: Get sha
id: get-sha
run: |
full_commit="${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha) }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: "Bundle and upload rerun_cpp_sdk.zip"
run: python3 ./scripts/ci/bundle_and_upload_rerun_cpp.py --git-hash ${{ steps.get-sha.outputs.sha }} --platform-filter=${{ inputs.PLATFORM_FILTER }}
+346
View File
@@ -0,0 +1,346 @@
name: "General checks: Lints, Tests, Docs"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
CHANNEL: # `nightly`/`main`/`pr`
required: true
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-checks
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
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
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-linux"
save_cache: true
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- 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
# ---------------------------------------------------------------------------
# NOTE: We don't want spurious failures caused by issues being closed, so this does not run on CI,
# at least for the time being.
# - name: Check for zombie TODOs
# run: |
# pixi run ./scripts/zombie_todos.py --token ${{ secrets.GITHUB_TOKEN }}
rerun-lints:
name: Rerun lints
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- 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
- name: Check dependencies
run: pixi run scripts/check_utils_dependencies.py
- name: Check forbidden dependencies
run: pixi run python scripts/check_forbidden_dependencies.py
- name: Check skills
run: pixi run python scripts/ci/check_skills.py
toml-format-check:
name: Toml format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Toml format check
run: pixi run toml-fmt-check
uv-lock-check:
name: Check uv.lock is up-to-date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Check uv.lock
run: pixi run uv-lock-check
check-too-large-files:
name: Check for too large files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- 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-publish-flags:
name: Check for wrong publish flags
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Check for wrong publish flags
run: pixi run check-publish-flags
check-example-thumbnails:
name: Check example thumbnails
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Check example thumbnails
# Use uv run --frozen python instead of uvpy.
# It's nice to get valid checks here even if the uv lockfile is out-of-date
# uv-lock-check will independently validate the lockfile status.
run: pixi run uv run --frozen python ./scripts/ci/thumbnails.py check
check-doc-order:
name: Check docs order
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Check docs order
run: pixi run uv run --frozen python ./scripts/ci/check_doc_order.py
check-no-d2-code-blocks:
name: Check for D2 code blocks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Check for D2 code blocks
# Use uv run --frozen python instead of uvpy.
# It's nice to get valid checks here even if the uv lockfile is out-of-date
# uv-lock-check will independently validate the lockfile status.
run: pixi run uv run --frozen python ./scripts/ci/check_d2_diagrams.py
check-example-manifest-coverage:
name: Check example manifest coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- 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: Check example manifest coverage
run: pixi run ./scripts/check_example_manifest_coverage.py
- name: Check the migration guide redirect
run: pixi run python scripts/ci/check_migration_guide_redirect.py
lint-md:
name: Lint markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- 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: Run linter
run: |
# Single quoted because pixi does its own glob expansion
pixi run mdlint --glob 'docs/content/**/*.md'
pixi run mdlint --glob 'examples/python/*/README.md'
pixi run mdlint --glob 'examples/cpp/*/README.md'
pixi run mdlint --glob 'examples/rust/*/README.md'
# ---------------------------------------------------------------------------
spell-check:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- name: Check spelling of entire workspace
uses: crate-ci/typos@v1.45.1
# ---------------------------------------------------------------------------
misc-formatting:
name: Misc formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: prettier --check
run: pixi run misc-fmt-check
# ---------------------------------------------------------------------------
link-checker:
name: Check links
runs-on: ubuntu-latest
# do not fail entire workflow (e.g. nightly) if this is the only failing check
continue-on-error: true
env:
# lychee uses this to avoid GitHub rate limiting when checking github.com links.
# See https://github.com/lycheeverse/lychee#github-token
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
# For PRs, we need to fetch the base branch to compare against
fetch-depth: 0
- name: Set up Python
if: github.event_name == 'pull_request'
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Restore lychee cache
id: restore-cache
uses: actions/cache/restore@v4
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Set up pixi for PR Link Checker
if: ${{ inputs.CHANNEL == 'pr' }}
uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
# For PRs: Check only links in added lines
- name: PR Link Checker (added lines only)
if: ${{ inputs.CHANNEL == 'pr' }}
run: |
# Fetch the base branch
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
# Run our custom PR link checker
pixi run link-check-pr origin/${{ github.base_ref }}
# For nightly: Check all links in the entire codebase
- name: Full Link Checker
if: ${{ inputs.CHANNEL == 'nightly' }}
id: lychee
uses: lycheeverse/lychee-action@v2.8.0
with:
fail: true
lycheeVersion: "v0.23.0"
# When given a directory, lychee checks only markdown, html and text files, everything else we have to glob in manually.
# If updating version or args update the pixi.toml to match.
args: |
--cache --max-cache-age 1d . --root-dir $(pwd) "**/*.md" "**/*.rs" "**/*.toml" "**/*.hpp" "**/*.cpp" "**/CMakeLists.txt" "**/*.py" "**/*.yml"
+122
View File
@@ -0,0 +1,122 @@
name: "C++ Tests on all platforms & compilers"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
CHANNEL:
required: false
type: string # enum: 'nightly', 'main', or 'pr'
workflow_dispatch:
inputs:
CONCURRENCY:
required: false
type: string
default: "adhoc"
CHANNEL:
required: false
type: string # enum: 'nightly', 'main', or 'pr'
concurrency:
group: ${{ inputs.CONCURRENCY }}-checks_cpp
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
matrix_prep:
runs-on: ubuntu-latest
outputs:
MATRIX: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- name: Load C++ test matrix
id: set-matrix
run: echo "matrix=$(jq -c . < ./.github/workflows/cpp_matrix_full.json)" >> $GITHUB_OUTPUT
cpp-tests:
name: C++ build & test - ${{ matrix.name }}
timeout-minutes: 60
needs: matrix_prep
strategy:
matrix: ${{ fromJson(needs.matrix_prep.outputs.MATRIX) }}
runs-on: ${{ matrix.runs_on }}
steps:
# Skipping the entire step would apparently require a separate job, not doing that here.
# Instead we keep checking for the `matrix.pr_ci` flag.
# See https://stackoverflow.com/questions/77186893/how-can-i-skip-the-whole-job-for-a-matrix-match-in-github-action
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
with:
pixi-version: v0.71.3
environments: cpp
- name: Set up Rust
uses: ./.github/actions/setup-rust
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
with:
cache_key: ${{ matrix.cache_key }}
# Cache will be produced by `reusable_checks/rs-lints`
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
# Workaround for ASAN issues on Github images https://github.com/actions/runner-images/issues/9491
- name: Fix kernel mmap rnd bits
if: ${{ (github.event_name != 'pull_request' || matrix.pr_ci != false) && runner.os == 'Linux' }}
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28
- name: pixi run -e cpp cpp-clean
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
run: pixi run -e cpp cpp-clean
- name: pixi run -e cpp cpp-build-all
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
run: ${{ matrix.extra_env_vars }} RERUN_WERROR=ON pixi run -e cpp cpp-build-all
- name: pixi run -e cpp cpp-test
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
run: ${{ matrix.extra_env_vars }} RERUN_WERROR=ON pixi run -e cpp cpp-test
- name: pixi run -e cpp cpp-build-all-shared-libs
if: ${{ inputs.CHANNEL == 'nightly' }}
run: ${{ matrix.extra_env_vars }} RERUN_WERROR=ON pixi run -e cpp cpp-build-all-shared-libs
- name: additional_commands
if: ${{ github.event_name != 'pull_request' || matrix.pr_ci != false }}
run: ${{ matrix.additional_commands }}
cpp-formatting:
name: C++ formatting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- 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
@@ -0,0 +1,36 @@
name: "Doc Redirects Check"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-checks_doc_redirects
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
jobs:
check-doc-redirects:
name: Check doc redirects
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
fetch-depth: 0 # Need full history for git diff against main
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Check doc redirects
run: pixi run python scripts/ci/check_doc_redirects.py --base origin/main
@@ -0,0 +1,61 @@
name: "Protobuf Checks: lints, BW compatibility, formatting, etc"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-checks_protobuf
cancel-in-progress: true
env:
# Make sure that git will not try and perform any kind of LFS filtering, otherwise
# this will completely break `buf` which invokes `git` under the hood.
GIT_LFS_SKIP_SMUDGE: 1
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
pb-check:
name: "Protobuf Checks: lints, BW compatibility, formatting, etc"
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Fetch latest main (so we can grab the current schema snapshot)
run: time git fetch origin main # yes, we need full --depth for `buf` to work
# NOTE(cmc): I'm keeping all the snapshot machinery around if it turns out we need something more robust
# than a pure git solution in the future. For now, convenience wins.
#
# - name: Schema snapshot out-of-sync
# run: pixi run pb-snapshot-check
# # continue-on-error: true
#
- name: Breaking changes
run: pixi run -q pb-breaking
if: success() || failure() # trigger this step even if the previous one failed
- name: Lints
run: pixi run pb-lint
if: success() || failure() # trigger this step even if the previous one failed
- name: Formatting
run: pixi run pb-fmt-check
if: success() || failure() # trigger this step even if the previous one failed
@@ -0,0 +1,85 @@
name: "Python Checks: Lints & Docs"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-checks_python
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
# ---------------------------------------------------------------------------
py-lints:
name: Python lints (ruff, mypy, …)
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- 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-notebook:
name: Notebook widget unit tests
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Run notebook tests
run: pixi run py-test-notebook
# ---------------------------------------------------------------------------
py-test-docs:
name: Test Python Docs
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- 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
+271
View File
@@ -0,0 +1,271 @@
name: "Rust Checks: Lints, Tests, Docs"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
CHANNEL:
required: false
type: string # enum: 'nightly', 'main', or 'pr'
concurrency:
group: ${{ inputs.CONCURRENCY }}-checks_rust
cancel-in-progress: true
env:
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
# Improve diagnostics for crashes.
RUST_BACKTRACE: full
# Sourced from https://vulkan.lunarg.com/sdk/home#linux
VULKAN_SDK_VERSION: "1.3.290.0"
# Via: https://nexte.st/docs/installation/pre-built-binaries/#using-nextest-in-github-actions
# 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"
id-token: "write"
jobs:
# ---------------------------------------------------------------------------
rs-lints:
name: Rust lints (fmt, check, clippy, doc)
timeout-minutes: 60
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
lfs: true
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-linux"
save_cache: true
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Rust checks (PR subset)
if: ${{ inputs.CHANNEL == 'pr' }}
run: pixi run rs-check --only base_checks sdk_variations cargo_deny denied_sdk_deps wasm docs
- name: Rust most checks (`main` branch subset)
if: ${{ inputs.CHANNEL == 'main' }}
run: pixi run rs-check --skip individual_crates docs_slow tests tests_without_all_features # Tests run in a separate job
- name: Rust all checks (nightly)
if: ${{ inputs.CHANNEL == 'nightly' }}
run: pixi run rs-check --skip tests tests_without_all_features # Tests run in a separate job
- name: .rrd backwards compatibility
# We don't yet guarantee backwards compatibility, but we at least check it
# so that we _know_ if/when we break it.
# See tests/assets/rrd/README.md for more
run: pixi run check-backwards-compatibility
- name: Check dependency tree (no cycles)
run: pixi run python scripts/ci/crates.py check-dependency-tree
rs-tests:
name: Test on Linux
timeout-minutes: 60
runs-on: ubuntu-latest-16-cores
env:
RUSTDOCFLAGS: ""
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
lfs: true
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-linux"
save_cache: true
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- 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
- name: Rust tests
run: pixi run rs-check --only tests
- name: Rust tests without --all-features (`main`/`nightly` channel)
if: ${{ inputs.CHANNEL != 'pr' }}
run: pixi run rs-check --only tests_without_all_features
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-linux
path: |
**/tests/snapshots
**/tests/failures
# Run tests on Mac and Windows (main channel)
mac-windows-tests-main:
name: Tests only (main)
timeout-minutes: 100 # Windows is very slow
strategy:
matrix:
include:
- runs_on: "macos-26-xlarge"
name: "macos"
- runs_on: "windows-latest-32-cores"
name: "windows"
if: ${{ inputs.CHANNEL == 'main' }}
runs-on: ${{ matrix.runs_on }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-${{ matrix.name }}"
save_cache: true
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
# Building with `--all-features` requires extra build tools like `nasm`.
- 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
- name: Rust tests
run: pixi run rs-check --only tests
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.name }}
path: |
**/tests/snapshots
**/tests/failures
# Run all checks on Mac and Windows (nightly channel, split across multiple jobs)
mac-windows-checks-nightly:
name: ${{ matrix.platform.name }}${{ matrix.checks_group.label }}
timeout-minutes: 100 # Windows is very slow
strategy:
fail-fast: false
matrix:
platform:
- runs_on: "macos-26-xlarge"
name: "macos"
- runs_on: "windows-latest-32-cores"
name: "windows"
checks_group:
- name: "base-and-deny"
checks: "base_checks sdk_variations cargo_deny denied_sdk_deps"
label: " (base & deny)"
- name: "wasm-and-examples"
checks: "wasm individual_examples"
label: " (wasm & examples)"
- name: "individual-crates"
checks: "individual_crates"
label: " (individual crates)"
- name: "docs"
checks: "docs docs_slow"
label: " (docs)"
- name: "tests"
checks: "tests"
label: " (tests)"
- name: "tests-default-features"
checks: "tests_without_all_features"
label: " (tests default features)"
if: ${{ inputs.CHANNEL == 'nightly' }}
runs-on: ${{ matrix.platform.runs_on }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-${{ matrix.platform.name }}-${{ matrix.checks_group.name }}"
save_cache: true
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
# Building with `--all-features` requires extra build tools like `nasm`.
- 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
- name: Rust checks
run: pixi run rs-check --only ${{ matrix.checks_group.checks }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.platform.name }}-${{ matrix.checks_group.name }}
path: |
**/tests/snapshots
**/tests/failures
+246
View File
@@ -0,0 +1,246 @@
name: "Reusable Deploy Docs"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
JS_DOCS_VERSION_NAME:
required: true
type: string
PY_DOCS_VERSION_NAME:
required: true
type: string
CPP_DOCS_VERSION_NAME:
required: true
type: string
MARKDOWN_DOCS_VERSION_NAME:
required: true
type: string
description: |
Version label to upload markdown docs/examples under on GCS
(`gs://rerun-docs/prose/{label}/`). Use `dev` for non-final
releases / pushes to main, the semver string for final
releases, or `pr-{N}` for PR previews.
RELEASE_VERSION:
required: false
type: string
RELEASE_COMMIT:
required: false
type: string
UPDATE_LATEST:
required: false
type: boolean
default: false
concurrency:
group: ${{ inputs.CONCURRENCY }}-deploy-docs
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
env:
PYTHON_VERSION: "3.10"
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
jobs:
# ---------------------------------------------------------------------------
py-deploy-docs:
name: Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Build docs
run: pixi run uv run --group docs mkdocs build -f rerun_py/mkdocs.yml -d site
- name: "Upload Python Docs (version)"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_py/site"
destination: "rerun-docs/docs/python/${{ inputs.PY_DOCS_VERSION_NAME }}"
process_gcloudignore: false
parent: false
resumable: false
- name: "Update URL rewrite rules for stable"
if: ${{ inputs.UPDATE_LATEST }}
run: |
pixi run uv run --group dev scripts/update_docs_url_rewrite.py --version ${{ inputs.PY_DOCS_VERSION_NAME }} --language python
- name: "Update versions.json"
if: ${{ inputs.UPDATE_LATEST }}
run: |
VERSION=${{ inputs.PY_DOCS_VERSION_NAME }}
echo "download existing"
gsutil cp gs://rerun-docs/docs/python/versions.json ./
cat versions.json
echo "remove `stable` alias"
jq -c 'map(.aliases |= map(select(. != "stable")))' versions.json > versions.json.new
cat versions.json.new
echo "prepend new version with `stable` alias"
jq -c --arg v "$VERSION" '[{ version: $v, title: $v, aliases: ["stable"] }] + .' versions.json.new > versions.json
cat versions.json
echo "overwrite the file on gcs"
gsutil cp ./versions.json gs://rerun-docs/docs/python/
# ---------------------------------------------------------------------------
cpp-deploy-docs:
name: Cpp
runs-on: ubuntu-latest
steps:
- name: Show context
run: |
echo "GITHUB_CONTEXT": $GITHUB_CONTEXT
echo "JOB_CONTEXT": $JOB_CONTEXT
echo "INPUTS_CONTEXT": $INPUTS_CONTEXT
echo "ENV_CONTEXT": $ENV_CONTEXT
env:
ENV_CONTEXT: ${{ toJson(env) }}
GITHUB_CONTEXT: ${{ toJson(github) }}
JOB_CONTEXT: ${{ toJson(job) }}
INPUTS_CONTEXT: ${{ toJson(inputs) }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Doxygen C++ docs
run: pixi run -e cpp cpp-docs
- name: "Upload C++ Docs (version)"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_cpp/docs/html"
destination: "rerun-docs/docs/cpp/${{ inputs.RELEASE_VERSION }}"
process_gcloudignore: false
parent: false
resumable: false
- name: "Upload C++ Docs (named)"
if: ${{ inputs.UPDATE_LATEST }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_cpp/docs/html"
destination: "rerun-docs/docs/cpp/${{ inputs.CPP_DOCS_VERSION_NAME }}"
process_gcloudignore: false
parent: false
resumable: false
js-deploy-docs:
name: JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Build docs
run: pixi run js-docs
- name: "Upload (version)"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js/docs"
destination: "rerun-docs/docs/js/${{ inputs.JS_DOCS_VERSION_NAME }}"
process_gcloudignore: false
parent: false
resumable: false
- name: "Update URL rewrite rules for stable"
if: ${{ inputs.UPDATE_LATEST }}
run: |
pixi run uv run --group dev scripts/update_docs_url_rewrite.py --version ${{ inputs.JS_DOCS_VERSION_NAME }} --language js
# ---------------------------------------------------------------------------
md-deploy-docs:
name: Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Upload markdown docs & examples to GCS"
env:
ISR_BYPASS_TOKEN: ${{ secrets.ISR_BYPASS_TOKEN }}
VERSION_LABEL: ${{ inputs.MARKDOWN_DOCS_VERSION_NAME }}
MARK_LATEST: ${{ inputs.UPDATE_LATEST }}
RERUN_COMMIT: ${{ inputs.RELEASE_COMMIT }}
run: |
ARGS=(upload --version "$VERSION_LABEL" --purge-token "$ISR_BYPASS_TOKEN")
if [ "$MARK_LATEST" = "true" ]; then
ARGS+=(--mark-latest)
fi
if [ -n "$RERUN_COMMIT" ]; then
ARGS+=(--rerun-commit "$RERUN_COMMIT")
fi
pixi run uv run scripts/ci/upload_docs.py "${ARGS[@]}"
@@ -0,0 +1,101 @@
name: Reusable Deploy Landing Preview
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
PR_NUMBER:
required: true
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-deploy-landing-preview
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.ref) || '' }}
- name: Get sha
id: get-sha
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$full_commit" >> "$GITHUB_OUTPUT"
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Upload PR-preview markdown docs & examples to GCS"
env:
ISR_BYPASS_TOKEN: ${{ secrets.ISR_BYPASS_TOKEN }}
PR_NUMBER: ${{ inputs.PR_NUMBER }}
RERUN_COMMIT: ${{ steps.get-sha.outputs.sha }}
run: |
# PR previews live under `gs://rerun-docs/prose/pr-{N}/` and
# are not advertised in versions.json. The production website
# reads them directly via `/docs/pr-{N}/…`, so re-uploads
# must purge that subtree from the edge ISR cache.
pixi run uv run scripts/ci/upload_docs.py upload \
--version "pr-${PR_NUMBER}" \
--rerun-commit "$RERUN_COMMIT" \
--purge-token "$ISR_BYPASS_TOKEN"
- name: Create PR comment
uses: mshick/add-pr-comment@v2.8.2
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
if: success()
with:
message-id: "vercel-preview"
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
Latest documentation preview uploaded successfully.
| Result | Commit | Link |
| ------ | ------- | ----- |
| ✅ | ${{ steps.get-sha.outputs.sha }} | https://rerun.io/docs/pr-${{ inputs.PR_NUMBER }} |
<sup>Note: This comment is updated whenever you push a commit.</sup>
- name: Create PR comment
uses: mshick/add-pr-comment@v2.8.2
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
if: failure()
with:
message-id: "vercel-preview"
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
Latest documentation preview failed to upload, check the CI for more details:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}
| Result | Commit | Link |
| ------ | ------- | ----- |
| ❌ | ${{ steps.get-sha.outputs.sha }} | unavailable |
<sup>Note: This comment is updated whenever you push a commit.</sup>
+69
View File
@@ -0,0 +1,69 @@
name: Reusable Pip Index
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
COMMIT:
required: false
type: string
default: ""
CHECK:
required: false
type: boolean
default: true
concurrency:
group: ${{ inputs.CONCURRENCY }}-pip-index
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
pr-summary:
name: Create a Pip Index file
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Install deps
# TOOD(googleapis/python-api-core#848): unpin google-api-core when this is issue is fixed.
run: pip3 install google-cloud-storage==3.4.1 Jinja2==3.1.6 google-api-core==2.27.0
- name: Render pip index and upload to gcloud
run: |
full_commit="${{ inputs.COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha) }}"
commit=$(echo $full_commit | cut -c1-7)
python scripts/ci/generate_prerelease_pip_index.py \
--title "Commit: $commit" \
--dir "commit/$commit/wheels" \
--upload \
${{ inputs.CHECK == 'true' && '--check' || '' }}
+101
View File
@@ -0,0 +1,101 @@
name: Build and publish JS
on:
workflow_call:
inputs:
concurrency:
type: string
required: true
release-commit:
description: "Commit to release"
type: string
required: true
release-version:
type: string
required: true
concurrency:
group: ${{ inputs.concurrency }}-publish-js
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
packages: "read"
jobs:
get-commit-sha:
name: Get Commit Sha
runs-on: ubuntu-latest
outputs:
short-sha: ${{ steps.get-short-sha.outputs.short-sha }}
full-sha: ${{ steps.get-full-sha.outputs.full-sha }}
steps:
- name: "Set short-sha"
id: get-short-sha
run: echo "short-sha=$(echo ${{ inputs.release-commit }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: "Set full-sha"
id: get-full-sha
run: echo "full-sha=${{ inputs.release-commit }}" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest-16-cores
needs: [get-commit-sha]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.release-commit }}
- uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
- name: Install Yarn
run: npm install -g yarn
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-web"
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Publish packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pixi run node rerun_js/scripts/publish.mjs
- name: "Upload rerun_js to GCS (version)"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/version/${{ inputs.release-version }}/rerun_js"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
gzip: false
# TODO(#11625): we need this for asset sync, in case the PR workflow fails (or doesn't run). See issue for details.
- name: "Upload rerun_js to GCS (commit)"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/commit/${{ needs.get-commit-sha.outputs.short-sha }}/rerun_js"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
gzip: false
@@ -0,0 +1,67 @@
name: Build and Publish C/C++ SDKs
on:
workflow_call:
inputs:
concurrency:
type: string
required: true
release-version:
description: "Release Version Number (Must match Cargo.toml)"
type: string
required: true
release-commit:
description: "Which commit to build+publish"
type: string
required: true
permissions:
contents: "read"
id-token: "write"
packages: "read"
jobs:
linux-arm64:
name: "Linux-Arm64"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: publish-rerun-c-linux-arm64-${{ github.ref_name }}
PLATFORM: linux-arm64
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
linux-x64:
name: "Linux-x64"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: publish-rerun-c-linux-x64-${{ github.ref_name }}
PLATFORM: linux-x64
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
macos-arm64:
name: "Mac-Arm"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: publish-rerun-c-macos-arm64-${{ github.ref_name }}
PLATFORM: macos-arm64
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
windows-x64:
name: "Windows-x64"
uses: ./.github/workflows/reusable_build_and_upload_rerun_c.yml
with:
CONCURRENCY: publish-rerun-c-windows-${{ github.ref_name }}
PLATFORM: windows-x64
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
bundle-and-upload-rerun_cpp:
name: "Bundle and upload rerun_cpp_sdk.zip"
needs: [linux-arm64, linux-x64, macos-arm64, windows-x64]
uses: ./.github/workflows/reusable_bundle_and_upload_rerun_cpp.yml
with:
CONCURRENCY: bundle-rerun-c-${{ github.ref_name }}
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
@@ -0,0 +1,58 @@
name: Build and publish wheels
on:
workflow_call:
inputs:
concurrency:
type: string
required: true
release-version:
description: "Release Version Number (Must match Cargo.toml)"
type: string
required: true
release-commit:
description: "Which commit to build+publish"
type: string
required: true
permissions:
contents: "read"
id-token: "write"
packages: "read"
jobs:
linux-arm64:
name: "Linux-arm64"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: publish-rerun-cli-linux-arm64-${{ github.ref_name }}
PLATFORM: linux-arm64
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
linux-x64:
name: "Linux-x64"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: publish-rerun-cli-linux-x64-${{ github.ref_name }}
PLATFORM: linux-x64
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
macos-arm64:
name: "Mac-Arm"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: publish-rerun-cli-macos-arm64-${{ github.ref_name }}
PLATFORM: macos-arm64
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
windows-x64:
name: "Windows-x64"
uses: ./.github/workflows/reusable_build_and_upload_rerun_cli.yml
with:
CONCURRENCY: publish-rerun-cli-windows-x64-${{ github.ref_name }}
PLATFORM: windows-x64
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
+157
View File
@@ -0,0 +1,157 @@
name: Build and publish web
on:
workflow_call:
inputs:
concurrency:
type: string
required: true
release-version:
description: "Release Version Number (Must match Cargo.toml)"
type: string
required: true
release-commit:
description: "Commit to release"
type: string
required: true
wheel-artifact-name:
description: "Name of the wheel to use when running examples"
type: string
required: true
update-latest:
description: "Whether to update the latest version of app"
type: boolean
required: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
packages: "read"
jobs:
get-commit-sha:
name: Get Commit Sha
runs-on: ubuntu-latest
outputs:
short-sha: ${{ steps.get-short-sha.outputs.short-sha }}
full-sha: ${{ steps.get-full-sha.outputs.full-sha }}
steps:
- name: "Set short-sha"
id: get-short-sha
run: echo "short-sha=$(echo ${{ inputs.release-commit }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: "Set full-sha"
id: get-full-sha
run: echo "full-sha=${{ inputs.release-commit }}" >> $GITHUB_OUTPUT
build-web:
runs-on: ubuntu-latest-16-cores
needs: [get-commit-sha]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.release-commit }}
lfs: true
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-web"
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Bootstrap examples
run: |
pixi run py-sync-examples
# built by `reusable_build_and_publish_wheels`
- name: Download Wheel
uses: actions/download-artifact@v4
with:
name: ${{ inputs.wheel-artifact-name }}
path: wheel
- name: Install built wheel
run: |
pixi run python scripts/ci/uv_install_wheel.py --package rerun-sdk --dir wheel
- name: Print wheel version
run: |
pixi run uv pip show rerun-sdk
pixi run uvpy -m rerun --version
- name: Build web-viewer (release)
run: |
pixi run rerun-build-web-release
- name: Build examples
run: |
pixi run build-examples rrd --install \
--channel "release" \
crates/viewer/re_web_viewer_server/web_viewer/examples
- name: Build & run snippets
run: |
pixi run build-examples snippets \
crates/viewer/re_web_viewer_server/web_viewer/examples/snippets
- name: Build examples manifest
run: |
pixi run build-examples manifest \
--base-url "https://app.rerun.io/version/${{inputs.release-version}}" \
--channel "release" \
crates/viewer/re_web_viewer_server/web_viewer/examples_manifest.json
- name: Upload app.rerun.io (versioned)
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/version/${{ inputs.release-version }}"
parent: false
process_gcloudignore: false
- name: Upload app.rerun.io (commit)
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/commit/${{ needs.get-commit-sha.outputs.short-sha }}"
parent: false
process_gcloudignore: false
# Upload extensionless HTML aliases (signed-in, signed-out) to the
# bucket root with the correct Content-Type. The OAuth redirect uses the
# origin (app.rerun.io/signed-in), not a versioned path.
- name: "Upload HTML aliases to bucket root"
run: |
cd crates/viewer/re_web_viewer_server/web_viewer
for f in *.html; do
name="${f%.html}"
if [ "$name" != "index" ] && [ "$name" != "index_bundled" ]; then
gcloud storage cp --content-type="text/html" "$f" "gs://rerun-web-viewer/${name}"
fi
done
- name: Publish app.rerun.io
if: inputs.update-latest
run: |
gsutil -m cp -r 'gs://rerun-web-viewer/version/${{ inputs.release-version }}/*' gs://rerun-web-viewer/version/latest
@@ -0,0 +1,141 @@
name: Build and publish wheels
# To run this manually:
# 1. Build each platform using `scripts/ci/build_and_upload_wheels.py`
# 2. (optional) Generate index using `scripts/ci/generate_prerelease_pip_index.py`
# 3. Publish to PyPI using `scripts/ci/publish_wheels.py`
on:
workflow_call:
inputs:
concurrency:
type: string
required: true
release-version:
description: "Release Version Number (Must match Cargo.toml)"
type: string
required: true
release-commit:
description: "Which commit to build+publish"
type: string
required: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
packages: "read"
jobs:
get-commit-sha:
name: Get Commit Sha
runs-on: ubuntu-latest
outputs:
short-sha: ${{ steps.get-short-sha.outputs.short-sha }}
full-sha: ${{ steps.get-full-sha.outputs.full-sha }}
steps:
- name: "Set short-sha"
id: get-short-sha
run: echo "short-sha=$(echo ${{ inputs.release-commit }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: "Set full-sha"
id: get-full-sha
run: echo "full-sha=${{ inputs.release-commit }}" >> $GITHUB_OUTPUT
## Build
# Note: this also builds `rerun_notebook`
build-linux-x64:
name: "Linux-x64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-linux-x64-${{ inputs.concurrency }}
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: linux-x64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
build-linux-arm64:
name: "Linux-arm64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-linux-arm64-${{ inputs.concurrency }}
PLATFORM: linux-arm64
WHEEL_ARTIFACT_NAME: linux-arm64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
build-windows-x64:
name: "Windows-x64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-windows-x64-${{ inputs.concurrency }}
PLATFORM: windows-x64
WHEEL_ARTIFACT_NAME: windows-x64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
build-macos-arm64:
name: "Macos-arm64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-macos-arm64-${{ inputs.concurrency }}
PLATFORM: macos-arm64
WHEEL_ARTIFACT_NAME: macos-arm64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
generate-wheel-index:
name: "Generate Pip Index"
needs:
[build-linux-x64, build-linux-arm64, build-windows-x64, build-macos-arm64]
uses: ./.github/workflows/reusable_pip_index.yml
with:
CONCURRENCY: generate-wheel-index-${{ inputs.concurrency }}
COMMIT: ${{ inputs.release-commit }}
secrets: inherit
publish-wheels:
name: "Publish Wheels"
needs: [get-commit-sha, generate-wheel-index]
runs-on: ubuntu-latest-16-cores
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Don't do a shallow clone since we need it for finding the full commit hash
ref: ${{ inputs.release-commit }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Publish to PyPI
run: |
pixi run uvpy scripts/ci/publish_wheels.py \
--version ${{ inputs.release-version }} \
--dir "commit/${{ needs.get-commit-sha.outputs.short-sha }}/wheels" \
--repository "${{ vars.PYPI_REPOSITORY }}" \
--token "${{ secrets.MATURIN_PYPI_TOKEN }}" \
@@ -0,0 +1,44 @@
name: Release crates
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
RELEASE_COMMIT:
required: false
type: string
concurrency:
group: ${{ inputs.CONCURRENCY }}-release-crates
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
packages: "read"
jobs:
publish-crates:
name: "Publish Crates"
runs-on: ubuntu-latest-16-cores
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || (github.event_name == 'pull_request' && github.event.pull_request.head.ref || '') }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Build web-viewer (release)
run: pixi run rerun-build-web-release
- name: Publish
run: pixi run python scripts/ci/crates.py publish --token ${{ secrets.CRATES_IO_TOKEN }}
@@ -0,0 +1,92 @@
# TODO(#9304): make the notebook export work
name: Reusable Build and Upload Notebook
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
WHEEL_ARTIFACT_NAME:
required: false
type: string
default: ""
concurrency:
group: ${{ inputs.CONCURRENCY }}-run-notebook
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
packages: "read"
jobs:
run-notebook:
name: Run notebook
runs-on: ubuntu-latest-16-cores # Note that as of writing we need the additional storage page (14 gb of the ubuntu-latest runner is not enough).
container:
image: ghcr.io/rerun-io/ci_docker:0.18.0 # Required to run the wheel or we get "No matching distribution found for attrs>=23.1.0" during `pip install rerun-sdk`
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Download Wheel
uses: actions/download-artifact@v4
with:
name: ${{ inputs.WHEEL_ARTIFACT_NAME }}
path: wheel
- name: Download Notebook Wheel
uses: actions/download-artifact@v4
with:
name: rerun_notebook_wheel
path: wheel
- name: Get version
id: get-version
run: |
pixi run 'echo "wheel_version=$(python scripts/ci/crates.py get-version)"' >> "$GITHUB_OUTPUT"
- name: Install built wheel
run: |
pixi run python scripts/ci/uv_install_wheel.py --package rerun-sdk --dir wheel
pixi run python scripts/ci/uv_install_wheel.py --package rerun-notebook --dir wheel --platform-independent
- name: Install Deps
run: pixi run uv pip install -r examples/python/notebook/requirements.txt
- name: Create notebook
run: pixi run uv jupyter nbconvert --to=html --ExecutePreprocessor.enabled=True examples/python/notebook/cube.ipynb --output /tmp/cube.html
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: Get sha
id: get-sha
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: "Upload Notebook"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "/tmp/cube.html"
destination: "rerun-builds/commit/${{ steps.get-sha.outputs.sha }}/notebooks"
parent: false
process_gcloudignore: false
@@ -0,0 +1,61 @@
name: Sync assets with release
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
RELEASE_VERSION:
required: true
type: string
default: ""
WAIT_TIME_SECS:
required: false
type: number
default: 0
concurrency:
group: ${{ inputs.CONCURRENCY }}-sync-assets
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
jobs:
sync-assets:
name: Upload assets from build.rerun.io
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Sync release assets & build.rerun.io
run: |
pixi run python ./scripts/ci/sync_release_assets.py \
--github-release ${{ inputs.RELEASE_VERSION }} \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--wait ${{ inputs.WAIT_TIME_SECS }} \
--remove --update
+196
View File
@@ -0,0 +1,196 @@
name: Reusable Test Wheels
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
PLATFORM:
required: true
type: string
WHEEL_ARTIFACT_NAME:
required: false
type: string
default: ""
RELEASE_COMMIT:
required: false
type: string
default: ""
FAST:
required: false
type: boolean
default: false
concurrency:
group: ${{ inputs.CONCURRENCY }}-test-wheels
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
RUST_BACKTRACE: "1"
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
packages: "read"
id-token: "write"
jobs:
# ---------------------------------------------------------------------------
set-config:
name: Set Config (${{ inputs.PLATFORM }})
runs-on: ubuntu-latest-16-cores
outputs:
RUNNER: ${{ steps.set-config.outputs.runner }}
TARGET: ${{ steps.set-config.outputs.target }}
CONTAINER: ${{ steps.set-config.outputs.container }}
steps:
- name: Login to GHCR (with retries)
uses: nick-fields/retry@v3
with:
timeout_seconds: 10
max_attempts: 12
retry_on: timeout
warning_on_retry: true
command: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Set runner and target based on platform
id: set-config
# TODO(#5525): at least this target is broken, maybe others — we currently only use linux-x64 and windows-x64
run: |
case "${{ inputs.PLATFORM }}" in
linux-arm64)
runner="ubuntu-arm-16-core"
target="aarch64-unknown-linux-gnu"
container="'ghcr.io/rerun-io/ci_docker:0.18.0'"
;;
linux-x64)
runner="ubuntu-latest-16-cores"
target="x86_64-unknown-linux-gnu"
container="'ghcr.io/rerun-io/ci_docker:0.18.0'"
;;
windows-x64)
runner="windows-latest-16-cores"
target="x86_64-pc-windows-msvc"
container="null"
;;
macos-arm64)
runner="macos-26-xlarge" # This is an Arm vm, https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners#about-macos-larger-runners
target="aarch64-apple-darwin"
container="null"
;;
*) echo "Invalid platform" && exit 1 ;;
esac
echo "runner=$runner" >> "$GITHUB_OUTPUT"
echo "target=$target" >> "$GITHUB_OUTPUT"
echo "container=$container" >> "$GITHUB_OUTPUT"
# ---------------------------------------------------------------------------
test-wheels:
name: Test Wheels (${{ needs.set-config.outputs.RUNNER }})
timeout-minutes: 120
needs: [set-config]
runs-on: ${{ needs.set-config.outputs.RUNNER }}
container:
image: ${{ fromJson(needs.set-config.outputs.CONTAINER) }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Show context
run: |
echo "GITHUB_CONTEXT": $GITHUB_CONTEXT
echo "JOB_CONTEXT": $JOB_CONTEXT
echo "INPUTS_CONTEXT": $INPUTS_CONTEXT
echo "ENV_CONTEXT": $ENV_CONTEXT
env:
ENV_CONTEXT: ${{ toJson(env) }}
GITHUB_CONTEXT: ${{ toJson(github) }}
JOB_CONTEXT: ${{ toJson(job) }}
INPUTS_CONTEXT: ${{ toJson(inputs) }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.RELEASE_COMMIT || ((github.event_name == 'pull_request' && github.event.pull_request.head.ref) || '') }}
lfs: true
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "build-${{ inputs.PLATFORM }}"
# Cache will be produced by `reusable_checks/rs-lints`
save_cache: false
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Download Wheel
uses: actions/download-artifact@v4
with:
name: ${{ inputs.WHEEL_ARTIFACT_NAME }}
path: wheel
- name: Get version
id: get-version
run: pixi run 'echo "wheel_version=$(python scripts/ci/crates.py get-version)"' >> "$GITHUB_OUTPUT"
- name: Install built wheel
run: |
pixi run python scripts/ci/uv_install_wheel.py --package rerun-sdk --dir wheel
- name: Print wheel version
run: |
pixi run uv pip show rerun-sdk
pixi run uvpy -m rerun --version
- name: Run unit tests (with linux arm64 opencv workaround)
if: ${{ inputs.PLATFORM == 'linux-arm64' }}
# Workaround for OpenCV TLS issue, see https://github.com/opencv/opencv/issues/14884#issuecomment-815632861
run: LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1 pixi run py-test-no-build
- name: Run unit tests
if: ${{ inputs.PLATFORM != 'linux-arm64' }}
run: pixi run py-test-no-build
- name: Run e2e test
run: RUST_LOG=debug pixi run uvpy scripts/run_python_e2e_test.py --no-build # rerun-sdk is already built and installed
- name: Check for release checklist
if: ${{ inputs.FAST }}
# Only check that the release checklist executes successfully
run: RUST_LOG=warn RERUN_STRICT=1 PYTHONWARNINGS=error pixi run uvpy tests/python/release_checklist/main.py --stdout > /dev/null
- name: Build C++ snippets
if: ${{ !inputs.FAST }}
# Separated out of compare_snippet_output.py run so we control the pixi environment.
# This used to cause issues on Windows during the setup of the pixi environment when running from inside `compare_snippet_output.py`.
run: pixi run cpp-build-snippets
- name: Run docs/snippets/compare_snippet_output.py
if: ${{ !inputs.FAST }}
# explicit target because otherwise cargo loses the target cache… even though this is the target anyhow…
# --no-py-build because rerun-sdk is already built and installed
run: RUST_LOG=debug pixi run uvpy docs/snippets/compare_snippet_output.py --target ${{ needs.set-config.outputs.TARGET }} --no-py-build --no-cpp-build
- name: Check the python library signatures
run: pixi run py-check-signatures
- name: Report disk usage
if: always() # Run this even if a previous step fails.
run: df -h
+184
View File
@@ -0,0 +1,184 @@
name: "Track Size"
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
PR_NUMBER:
required: false
type: number
WITH_EXAMPLES:
required: true
type: boolean
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: write
id-token: write
deployments: write
pull-requests: write
jobs:
track-sizes:
name: "Track Sizes"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we need full history
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- name: Get context
id: context
run: |
echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> "$GITHUB_OUTPUT"
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Download web_viewer
uses: actions/download-artifact@v4
with:
name: web_viewer
path: "crates/viewer/re_web_viewer_server/web_viewer"
- name: Download examples
if: ${{ inputs.WITH_EXAMPLES }}
uses: actions/download-artifact@v4
with:
name: example_data
path: example_data
- name: Download base results
run: |
# Get base commit:
# 1. From the index file
# 2. From the latest commit in the base branch of the PR
# 3. From the latest commit in the current branch
index_path="gs://rerun-builds/sizes/index"
if [ "$(gsutil -q stat $index_path ; echo $?)" = 0 ]; then
gsutil cp $index_path "/tmp/base_index"
base_commit=$(cat /tmp/base_index)
else
if [ -n ${{ inputs.PR_NUMBER }} ]; then
base_commit=$(echo ${{ github.event.pull_request.base.sha }} | cut -c1-7)
else
base_commit=${{ steps.context.outputs.short_sha }}
fi
fi
echo "base commit: $base_commit"
# Download data for base commit, or default to empty file
data_path="gs://rerun-builds/sizes/commit/$base_commit/data.json"
if [ "$(gsutil -q stat $data_path ; echo $?)" = 0 ]; then
gsutil cp $data_path "/tmp/prev.json"
else
echo "[]" > "/tmp/prev.json"
fi
- name: Measure sizes
id: measure
run: |
entries=()
entries+=("Wasm:crates/viewer/re_web_viewer_server/web_viewer/re_viewer_bg.wasm:MiB")
entries+=("JS:crates/viewer/re_web_viewer_server/web_viewer/re_viewer.js:kiB")
if [ ${{ inputs.WITH_EXAMPLES }} = "true" ]; then
for file in example_data/*.rrd; do
name=$(basename "$file")
entries+=("$name:$file:MiB")
done
fi
python3 scripts/ci/count_bytes.py "${entries[@]}" > /tmp/sizes.json
python3 scripts/ci/count_dependencies.py -p re_sdk --no-default-features > /tmp/deps1.json
python3 scripts/ci/count_dependencies.py -p re_viewer --all-features > /tmp/deps2.json
python3 scripts/ci/count_dependencies.py -p rerun --all-features > /tmp/deps3.json
# Merge the results, putting dependencies first (on top):
jq -s '.[0] + .[1] + .[2] + .[3]' /tmp/deps1.json /tmp/deps2.json /tmp/deps3.json /tmp/sizes.json > /tmp/data.json
comparison=$(
python3 scripts/ci/compare.py \
--threshold=2% \
--before-header=${{ (inputs.PR_NUMBER && github.event.pull_request.base.ref) || 'Before' }} \
--after-header=${{ github.ref_name }} \
"/tmp/prev.json" "/tmp/data.json"
)
{
echo 'comparison<<EOF'
echo "$comparison"
echo EOF
} >> "$GITHUB_OUTPUT"
if [ -n "$comparison" ]; then
echo "is_comparison_set=true" >> "$GITHUB_OUTPUT"
echo "is_comparison_set=true"
else
echo "is_comparison_set=false" >> "$GITHUB_OUTPUT"
echo "is_comparison_set=false"
fi
echo "$entries"
echo "previous: $(cat /tmp/prev.json)"
echo "current: $(cat /tmp/data.json)"
echo "$comparison"
- name: Upload data to GCS (commit)
uses: google-github-actions/upload-cloud-storage@v3
with:
path: /tmp/data.json
destination: "rerun-builds/sizes/commit/${{ steps.context.outputs.short_sha }}"
process_gcloudignore: false
- name: Create index file
if: github.ref == 'refs/heads/main'
run: |
echo "${{ steps.context.outputs.short_sha }}" > "/tmp/index"
- name: Upload index
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v3
with:
path: /tmp/index
destination: "rerun-builds/sizes"
process_gcloudignore: false
- name: Create PR comment
if: inputs.PR_NUMBER != '' && steps.measure.outputs.is_comparison_set == 'true'
# https://github.com/mshick/add-pr-comment
uses: mshick/add-pr-comment@v3.9.1
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
# Size changes
${{ steps.measure.outputs.comparison }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Render benchmark result
if: github.ref == 'refs/heads/main'
run: |
pixi run python scripts/ci/render_bench.py sizes \
--after $(date -d"180 days ago" +%Y-%m-%d) \
--output "gs://rerun-builds/graphs"
@@ -0,0 +1,138 @@
name: Reusable Upload Examples
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
ADHOC_NAME:
type: string
required: false
default: ""
MARK_TAGGED_VERSION:
required: false
type: boolean
default: false
RELEASE_VERSION:
required: false
type: string
default: "prerelease"
PR_NUMBER:
type: string
default: ""
NIGHTLY:
required: false
type: boolean
default: false
concurrency:
group: ${{ inputs.CONCURRENCY }}-upload-examples
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
upload-web:
name: Upload Examples to Google Cloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- name: Download assets
uses: actions/download-artifact@v4
with:
name: example_data
path: example_data
# Upload the wasm, html etc to a Google cloud bucket:
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: Get sha
id: get-sha
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: "Upload examples (commit)"
if: ${{ !inputs.NIGHTLY }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "example_data"
destination: "rerun-web-viewer/commit/${{ steps.get-sha.outputs.sha }}/examples"
parent: false
process_gcloudignore: false
- name: "Upload examples (tagged)"
if: inputs.MARK_TAGGED_VERSION
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "example_data"
destination: "rerun-web-viewer/version/${{ inputs.RELEASE_VERSION }}/examples"
parent: false
process_gcloudignore: false
- name: "Upload examples (adhoc)"
if: ${{ inputs.ADHOC_NAME != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "example_data"
destination: "rerun-web-viewer/adhoc/${{ inputs.ADHOC_NAME }}/examples"
parent: false
process_gcloudignore: false
- name: "Upload examples (prerelease)"
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "example_data"
destination: "rerun-web-viewer/prerelease/examples"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
- name: "Upload examples (main)"
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "example_data"
destination: "rerun-web-viewer/version/main/examples"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
- name: "Upload examples (pr)"
if: ${{ inputs.PR_NUMBER != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "example_data"
destination: "rerun-web-viewer/pr/${{ inputs.PR_NUMBER }}/examples"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
- name: "Upload examples (nightly)"
if: ${{ inputs.NIGHTLY }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "example_data"
destination: "rerun-web-viewer/version/nightly/examples"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
+147
View File
@@ -0,0 +1,147 @@
name: Reusable Upload rerun_js
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
ADHOC_NAME:
type: string
required: false
default: ""
MARK_TAGGED_VERSION:
required: false
type: boolean
default: false
RELEASE_VERSION:
required: false
type: string
default: "prerelease"
PR_NUMBER:
required: false
type: string
default: ""
NIGHTLY:
required: false
type: boolean
default: false
concurrency:
group: ${{ inputs.CONCURRENCY }}-upload-js
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
jobs:
upload-web:
name: Upload rerun_js to google cloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- name: Download rerun_js package
uses: actions/download-artifact@v4
with:
name: rerun_js
path: rerun_js_package
# Upload the wasm, html etc to a Google cloud bucket:
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: Get sha
id: get-sha
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: "Upload rerun_js (commit)"
if: ${{ !inputs.NIGHTLY }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/commit/${{ steps.get-sha.outputs.sha }}/rerun_js"
parent: false
process_gcloudignore: false
gzip: false
- name: "Upload rerun_js (tagged)"
if: inputs.MARK_TAGGED_VERSION
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/version/${{inputs.RELEASE_VERSION}}/rerun_js"
parent: false
process_gcloudignore: false
gzip: false
- name: "Upload rerun_js (adhoc)"
if: ${{ inputs.ADHOC_NAME != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/adhoc/${{inputs.ADHOC_NAME}}/rerun_js"
parent: false
process_gcloudignore: false
gzip: false
- name: "Upload rerun_js (prerelease)"
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/prerelease/rerun_js"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
gzip: false
- name: "Upload rerun_js (main)"
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/version/main/rerun_js"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
gzip: false
- name: "Upload rerun_js (pr)"
if: ${{ inputs.PR_NUMBER != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/pr/${{ inputs.PR_NUMBER }}/rerun_js"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
gzip: false
- name: "Upload rerun_js (nightly)"
if: ${{ inputs.NIGHTLY }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "rerun_js_package"
destination: "rerun-builds/version/nightly/rerun_js"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
gzip: false
+198
View File
@@ -0,0 +1,198 @@
name: Reusable Upload Web
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
ADHOC_NAME:
type: string
required: false
default: ""
MARK_TAGGED_VERSION:
required: false
type: boolean
default: false
RELEASE_VERSION:
required: false
type: string
default: "prerelease"
PR_NUMBER:
required: false
type: string
default: ""
NIGHTLY:
required: false
type: boolean
default: false
concurrency:
group: ${{ inputs.CONCURRENCY }}-upload-web
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
jobs:
upload-web:
name: Upload web build to google cloud (wasm32 + wasm-bindgen)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- name: Download Web Viewer
uses: actions/download-artifact@v4
with:
name: web_viewer
path: "crates/viewer/re_web_viewer_server/web_viewer"
# Upload the wasm, html etc to a Google cloud bucket:
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Get sha
id: get-sha
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: "Upload web-viewer (commit)"
if: ${{ !inputs.NIGHTLY }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/commit/${{ steps.get-sha.outputs.sha }}"
parent: false
process_gcloudignore: false
- name: "Upload web-viewer (tagged)"
if: inputs.MARK_TAGGED_VERSION
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/version/${{inputs.RELEASE_VERSION}}"
parent: false
process_gcloudignore: false
- name: "Upload web-viewer (adhoc)"
if: ${{ inputs.ADHOC_NAME != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/adhoc/${{inputs.ADHOC_NAME}}"
parent: false
process_gcloudignore: false
- name: "Upload web-viewer (prerelease)"
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/prerelease"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
- name: "Upload web-viewer (main)"
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/version/main"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
- name: "Upload web-viewer (pr)"
if: ${{ inputs.PR_NUMBER != '' }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/pr/${{ inputs.PR_NUMBER }}"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
- name: "Upload web-viewer (nightly)"
if: ${{ inputs.NIGHTLY }}
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "crates/viewer/re_web_viewer_server/web_viewer"
destination: "rerun-web-viewer/version/nightly"
parent: false
process_gcloudignore: false
headers: |-
cache-control: no-cache, max-age=0
# Upload extensionless HTML aliases (signed-in, signed-out) to the
# bucket root with the correct Content-Type. The OAuth redirect uses the
# origin (app.rerun.io/signed-in), not a versioned path.
- name: "Upload HTML aliases to bucket root"
run: |
cd crates/viewer/re_web_viewer_server/web_viewer
for f in *.html; do
name="${f%.html}"
if [ "$name" != "index" ] && [ "$name" != "index_bundled" ]; then
gcloud storage cp --content-type="text/html" "$f" "gs://rerun-web-viewer/${name}"
fi
done
- name: Status comment
if: success() && github.event_name == 'pull_request'
# https://github.com/mshick/add-pr-comment
uses: mshick/add-pr-comment@v3.9.1
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
with:
message-id: "web-viewer-build-status"
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
Web viewer built successfully.
| Result | Commit | Link | Manifest |
| ------ | ------- | ---- | -------- |
| ✅ | ${{ steps.get-sha.outputs.sha }} | https://rerun.io/viewer/pr/${{ github.event.pull_request.number }} | [`+nightly`](https://rerun.io/viewer/pr/${{ github.event.pull_request.number }}?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) [`+main`](https://rerun.io/viewer/pr/${{ github.event.pull_request.number }}?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) |
View image diff on [kitdiff](https://rerun-io.github.io/kitdiff/?url=${{github.event.pull_request.html_url}}).
<sup>Note: This comment is updated whenever you push a commit.</sup>
- name: Status comment
if: failure() && github.event_name == 'pull_request'
# https://github.com/mshick/add-pr-comment
uses: mshick/add-pr-comment@v3.9.1
# GitHub API is very unreliable. We don't want to fail the entire workflow just because we couldn't post a comment.
continue-on-error: true
with:
message-id: "web-viewer-build-status"
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: |
Web viewer failed to build.
| Result | Commit | Link | Manifest |
| ------ | ------- | ----- |
| ❌ | ${{ steps.get-sha.outputs.sha }} | https://rerun.io/viewer/pr/${{ github.event.pull_request.number }} | [`+nightly`](https://rerun.io/viewer/pr/${{ github.event.pull_request.number }}?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) [`+main`](https://rerun.io/viewer/pr/${{ github.event.pull_request.number }}?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) |
View image diff on [kitdiff](https://rerun-io.github.io/kitdiff/?url=${{github.event.pull_request.html_url}}).
<sup>Note: This comment is updated whenever you push a commit.</sup>
+62
View File
@@ -0,0 +1,62 @@
name: Reusable Web tests
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
REF:
required: false
type: string
default: ""
concurrency:
group: ${{ inputs.CONCURRENCY }}-web-test
cancel-in-progress: true
env:
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
RUST_BACKTRACE: full
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
jobs:
web-test:
name: Browser tests
timeout-minutes: 60
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.REF || (github.event_name == 'pull_request' && github.event.pull_request.head.ref) || '' }}
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
cache_key: "web-test"
save_cache: false
targets: wasm32-unknown-unknown
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Set up Firefox
uses: browser-actions/setup-firefox@v1
- name: Set up geckodriver
uses: browser-actions/setup-geckodriver@latest
- name: Run Wasm browser tests
run: pixi run web-test
@@ -0,0 +1,43 @@
# This workflow can be triggered via kitdiff's "Update snapshots" button, when viewing snapshots
# from a specific run.
name: Update kittest snapshots
on:
workflow_dispatch:
inputs:
run_id:
description: "The run ID that produced the artifact"
required: true
type: string
permissions:
actions: read
jobs:
update-snapshots:
name: Update snapshots from artifact
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
lfs: true
# We can't use the workflow token since that would prevent our commit to cause further workflows.
# See https://github.com/stefanzweifel/git-auto-commit-action#commits-made-by-this-action-do-not-trigger-new-workflow-runs
# This token should be a personal access token with at least Read and write permission to `Contents`.
# The commit action below will use the token this the code was checked out with.
token: "${{ secrets.SNAPSHOT_COMMIT_GITHUB_TOKEN }}"
- name: Accept snapshots
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.event.inputs.run_id }}
run: ./scripts/update_snapshots_from_ci.sh
- name: Git status
run: git status
- uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update snapshot images"