Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI and other stuff from rerun_template #1

Merged
merged 18 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copied from https://github.com/rerun-io/rerun_template

# 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: PR Labels

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

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"
29 changes: 29 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copied from https://github.com/rerun-io/rerun_template
on: [push, pull_request]

name: Link checker

jobs:
link-checker:
name: Check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Restore link checker cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

# Check https://github.com/lycheeverse/lychee on how to run locally.
- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
with:
fail: true
lycheeVersion: "0.14.3"
# When given a directory, lychee checks only markdown, html and text files, everything else we have to glob in manually.
args: |
--base . --cache --max-cache-age 1d . "**/*.rs" "**/*.toml" "**/*.hpp" "**/*.cpp" "**/CMakeLists.txt" "**/*.py" "**/*.yml"
109 changes: 109 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Copied from https://github.com/rerun-io/rerun_template
on: [push, pull_request]

name: Rust

env:
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings

jobs:
rust-check:
name: Rust
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: 1.76.0
override: true

- name: Install packages (Linux)
uses: awalsh128/[email protected]
with:
# Random stuff required by `bevy`
packages: libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libasound2-dev libudev-dev
version: 1.0
execute_install_scripts: true

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2

- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Install cargo-cranky
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-cranky

- name: check --all-features
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features --all-targets

- name: check default features
uses: actions-rs/cargo@v1
with:
command: check
args: --all-targets

- name: check --no-default-features
uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features --lib --all-targets

- name: Test doc-tests
uses: actions-rs/cargo@v1
with:
command: test
args: --doc --all-features

- name: cargo doc --lib
uses: actions-rs/cargo@v1
with:
command: doc
args: --lib --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: Build tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-run

- name: Run test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features

- name: Cranky
uses: actions-rs/cargo@v1
with:
command: cranky
args: --all-targets --all-features -- -D warnings

# ---------------------------------------------------------------------------

cargo-deny:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
rust-version: "1.76.0"
log-level: warn
command: check
19 changes: 19 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copied from https://github.com/rerun-io/rerun_template

# https://github.com/crate-ci/typos
# Add exceptions to `.typos.toml`
# install and run locally: cargo install typos-cli && typos

name: Spell Check
on: [pull_request]

jobs:
run:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Check spelling of entire workspace
uses: crate-ci/typos@master
61 changes: 7 additions & 54 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,59 +1,12 @@
# Mac stuff:
.DS_Store

# Codegen stuff:
crates/re_types/source_hash.txt
crates/re_types_builder/source_hash.txt
# Rust compile target directories:
target
target_ra
target_wasm

# C++ and CMake stuff:
*.a
*.bin
*.o
**/arrow/
**/build/
**/build-msvc/
**/CMakeFiles/
**/CMakeCache.txt
**/Makefile
**/cmake_install.cmake
_deps
**/.cache/
**/rerun_cpp/docs/html
# https://github.com/lycheeverse/lychee
.lycheecache

# Rust compile target directory:
**/target
**/target_ra
**/target_wasm

# Python virtual environment:
**/venv*
.python-version

# Python build artifacts:
__pycache__
*.pyc
*.so

# Pixi environment
.pixi

.gdb_history
perf.data*

**/dataset/

# Screenshots from samples etc.
screenshot*.png

# Saved example `.rrd` files
example_data

# Various builds
dist
wheels

# Screenshot comparison build
/compare_screenshot

.nox/
*.rrd
assets
6 changes: 6 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# https://github.com/crate-ci/typos
# install: cargo install typos-cli
# run: typos

[default.extend-words]
teh = "teh" # part of @teh-cmc
Loading
Loading