Skip to content

Fix failure to save files when split table contains no data #7108

Fix failure to save files when split table contains no data

Fix failure to save files when split table contains no data #7108

Workflow file for this run

name: CI (Rust)
on:
push:
branches:
- "main"
pull_request:
workflow_dispatch:
inputs:
force_update_web_build:
description: "Upload web build to google cloud"
required: true
default: false
type: boolean
force_run_benchmarks:
description: "Run the rust benchmarks"
required: true
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Cancel previous CI jobs on the same branch
cancel-in-progress: true
env:
# web_sys_unstable_apis is required to enable the web_sys clipboard API which egui_web uses
# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
RUSTFLAGS: --cfg=web_sys_unstable_apis --deny warnings
# See https://github.com/ericseppanen/cargo-cranky/issues/8
RUSTDOCFLAGS: --deny warnings --deny rustdoc::missing_crate_level_docs
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
jobs:
# See the benchmarks at https://ref.rerun.io/dev/bench/
rs-benchmarks:
name: Rust Criterion benchmarks
# Only run the rs-benchmarks job when a commit gets pushed to main or we manually specify it
if: ${{ github.ref == 'refs/heads/main' || github.event.inputs.force_run_benchmarks }}
runs-on: ubuntu-latest-16-cores
container:
image: rerunio/ci_docker:0.6
env:
RUSTFLAGS: ${{env.RUSTFLAGS}}
RUSTDOCFLAGS: ${{env.RUSTDOCFLAGS}}
steps:
- uses: actions/checkout@v3
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
env-vars: CARGO CC CFLAGS CXX CMAKE RUST CACHE_KEY
# Don't update the cache -- it will be updated by the lint job
# TODO(jleibs): this job will likely run before rust.yml updates
# the cache. Better cross-job sequencing would be nice here
save-if: false
- name: Run benchmark
# Use bash shell so we get pipefail behavior with tee
shell: bash
run: |
cargo bench \
--all-features \
-p re_arrow_store \
-p re_data_store \
-p re_log_encoding \
-p re_query \
-p re_tuid \
-- --output-format=bencher | tee output.txt
- name: Store benchmark result
# https://github.com/benchmark-action/github-action-benchmark
uses: benchmark-action/github-action-benchmark@v1
with:
name: Rust Benchmark
tool: "cargo"
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
# Show alert with commit comment on detecting possible performance regression
comment-on-alert: true
alert-threshold: "150%"
fail-on-alert: true
comment-always: false # Generates too much GitHub notification spam
# Save, results and push to GitHub only on main
save-data-file: ${{ github.ref == 'refs/heads/main' }}
auto-push: ${{ github.ref == 'refs/heads/main' }}
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
max-items-in-chart: 30
# ---------------------------------------------------------------------------
rs-lints:
name: Rust lints (fmt, check, cranky, tests, doc)
runs-on: ubuntu-latest-16-cores
container:
image: rerunio/ci_docker:0.6
env:
RUSTFLAGS: ${{env.RUSTFLAGS}}
RUSTDOCFLAGS: ${{env.RUSTDOCFLAGS}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Don't do a shallow clone since we need to push gh-pages
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
env-vars: CARGO CC CFLAGS CXX CMAKE RUST CACHE_KEY
# See: https://github.com/rerun-io/rerun/pull/497
save-if: ${{ github.event_name == 'push'}}
# First do our check with --locked to make sure `Cargo.lock` is up to date
- name: Check all features
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --all-features
- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Cranky
uses: actions-rs/cargo@v1
with:
command: cranky
args: --all-targets --all-features -- --deny warnings
# --------------------------------------------------------------------------------
# Check a few important permutations of the feature flags for our `rerun` library:
- name: Check rerun with `--no-default-features``
uses: actions-rs/cargo@v1
with:
command: cranky
args: --locked -p rerun --no-default-features
- name: Check rerun with `--features sdk`
uses: actions-rs/cargo@v1
with:
command: cranky
args: --locked -p rerun --no-default-features --features sdk
# --------------------------------------------------------------------------------
- name: Test doc-tests
uses: actions-rs/cargo@v1
with:
command: test
args: --doc --all-features
- name: cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --all-features
- name: cargo doc --document-private-items
uses: actions-rs/cargo@v1
with:
command: doc
args: --document-private-items --no-deps --all-features
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets --all-features
- name: Set up git author
if: ${{ github.event_name == 'push' }}
run: |
remote_repo="https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up ghp-import
if: ${{ github.event_name == 'push' }}
run: pip install ghp-import
- name: Patch in a redirect page
if: ${{ github.event_name == 'push' }}
run: echo "<meta http-equiv=\"refresh\" content=\"0; url=${REDIRECT_CRATE}\">" > target/doc/index.html
env:
REDIRECT_CRATE: rerun
# See: https://github.com/c-w/ghp-import
- name: Deploy the docs
if: ${{ github.event_name == 'push' }}
run: |
git fetch
python3 -m ghp_import -n -p -x docs/rust/head target/doc/ -m "Update the rust docs"
# ---------------------------------------------------------------------------
rs-check-wasm:
name: Check Rust web build (wasm32 + wasm-bindgen)
runs-on: ubuntu-latest-16-cores
container:
image: rerunio/ci_docker:0.6
env:
RUSTFLAGS: ${{env.RUSTFLAGS}}
RUSTDOCFLAGS: ${{env.RUSTDOCFLAGS}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: 1.67.1
target: wasm32-unknown-unknown
override: true
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
env-vars: CARGO CC CFLAGS CXX CMAKE RUST CACHE_KEY
# See: https://github.com/rerun-io/rerun/pull/497
save-if: ${{ github.event_name == 'push'}}
- name: clippy check re_viewer wasm32
run: ./scripts/clippy_wasm.sh
- name: Check re_renderer examples wasm32
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --target wasm32-unknown-unknown --target-dir target_wasm -p re_renderer --examples
- name: Build web-viewer (debug)
uses: actions-rs/cargo@v1
with:
command: run
args: --locked -p re_build_web_viewer -- --debug
# ---------------------------------------------------------------------------
rs-build-web-viewer:
name: Upload web build to google cloud (wasm32 + wasm-bindgen)
permissions:
contents: "read"
id-token: "write"
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || github.event.inputs.force_update_web_build
runs-on: ubuntu-latest-16-cores
container:
image: rerunio/ci_docker:0.6
env:
RUSTFLAGS: ${{env.RUSTFLAGS}}
RUSTDOCFLAGS: ${{env.RUSTDOCFLAGS}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.67.0
target: wasm32-unknown-unknown
override: true
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
env-vars: CARGO CC CFLAGS CXX CMAKE RUST CACHE_KEY
# See: https://github.com/rerun-io/rerun/pull/497
save-if: ${{ github.event_name == 'push'}}
- name: Patch Cargo.toml for pre-release
if: "!startsWith(github.ref , 'refs/tags/v')"
# After patching the pre-release version, run cargo update.
# This updates the cargo.lock file with the new version numbers and keeps the wheel build from failing
run: |
python3 scripts/version_util.py --patch_prerelease
cargo update -w
- name: Build web-viewer (release)
uses: actions-rs/cargo@v1
with:
command: run
args: --locked -p re_build_web_viewer -- --release
# Upload the wasm, html etc to a Google cloud bucket:
- id: "auth"
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${{github.sha}} | cut -c1-7`" >> $GITHUB_ENV
- name: "Upload web-viewer (commit)"
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_viewer"
destination: "rerun-web-viewer/commit/${{env.SHORT_SHA}}"
parent: false
- name: "Upload web-viewer (prerelease)"
if: github.ref == 'refs/heads/main'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_viewer"
destination: "rerun-web-viewer/prerelease"
parent: false
- name: "Upload web-viewer (tagged)"
if: startsWith(github.ref, 'refs/tags/v')
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_viewer"
destination: "rerun-web-viewer/version/${{github.ref_name}}"
parent: false
- name: "Upload web-viewer (latest release)"
if: github.ref == 'latest'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: "web_viewer"
destination: "rerun-web-viewer/latest"
parent: false
# ---------------------------------------------------------------------------
rs-cargo-deny:
name: Check Rust dependencies (cargo-deny)
runs-on: ubuntu-latest-16-cores
container:
image: rerunio/ci_docker:0.6
env:
RUSTFLAGS: ${{env.RUSTFLAGS}}
RUSTDOCFLAGS: ${{env.RUSTDOCFLAGS}}
# TODO(emilk): remove this matrix when https://github.com/EmbarkStudios/cargo-deny/issues/324 is resolved
strategy:
fail-fast: false
matrix:
platform:
- i686-pc-windows-gnu
- i686-pc-windows-msvc
- i686-unknown-linux-gnu
- wasm32-unknown-unknown
- x86_64-apple-darwin
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
- x86_64-unknown-redox
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
log-level: error
arguments: --all-features --target ${{ matrix.platform }}