Skip to content

Commit 2adefc8

Browse files
committed
Add CI, license, contributing, CoC, etc etc
1 parent 429e8d3 commit 2adefc8

34 files changed

+2340
-1
lines changed

.cargo/config.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# clipboard api is still unstable, so web-sys requires the below flag to be passed for copy (ctrl + c) to work
2+
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
3+
# check status at https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
4+
# we don't use `[build]` because of rust analyzer's build cache invalidation https://github.com/emilk/eframe_template/issues/93
5+
[target.wasm32-unknown-unknown]
6+
rustflags = ["--cfg=web_sys_unstable_apis"]

.github/workflows/labels.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
3+
# https://github.com/marketplace/actions/require-labels
4+
# Check for existence of labels
5+
# See all our labels at https://github.com/rerun-io/rerun/issues/labels
6+
7+
name: PR Labels
8+
9+
on:
10+
pull_request:
11+
types:
12+
- opened
13+
- synchronize
14+
- reopened
15+
- labeled
16+
- unlabeled
17+
18+
jobs:
19+
label:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check for a "do-not-merge" label
23+
uses: mheap/github-action-required-labels@v3
24+
with:
25+
mode: exactly
26+
count: 0
27+
labels: "do-not-merge"
28+
29+
- name: Require label "include in changelog" or "exclude from changelog"
30+
uses: mheap/github-action-required-labels@v3
31+
with:
32+
mode: minimum
33+
count: 1
34+
labels: "exclude from changelog, include in changelog"

.github/workflows/links.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on: [push, pull_request]
3+
4+
name: Link checker
5+
6+
jobs:
7+
link-checker:
8+
name: Check links
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Restore link checker cache
14+
uses: actions/cache@v3
15+
with:
16+
path: .lycheecache
17+
key: cache-lychee-${{ github.sha }}
18+
restore-keys: cache-lychee-
19+
20+
# Check https://github.com/lycheeverse/lychee on how to run locally.
21+
- name: Link Checker
22+
id: lychee
23+
uses: lycheeverse/[email protected]
24+
with:
25+
fail: true
26+
lycheeVersion: "0.14.3"
27+
# When given a directory, lychee checks only markdown, html and text files, everything else we have to glob in manually.
28+
args: |
29+
--base . --cache --max-cache-age 1d . "**/*.rs" "**/*.toml" "**/*.hpp" "**/*.cpp" "**/CMakeLists.txt" "**/*.py" "**/*.yml"

.github/workflows/pages.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Github Pages
2+
3+
# By default, runs if you push to main. keeps your deployed app in sync with main branch.
4+
on:
5+
push:
6+
branches:
7+
- main
8+
# to only run when you do a new github release, comment out above part and uncomment the below trigger.
9+
# on:
10+
# release:
11+
# types:
12+
# - published
13+
14+
permissions:
15+
contents: write # for committing to gh-pages branch.
16+
17+
jobs:
18+
build-github-pages:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4 # repo checkout
22+
- name: Setup toolchain for wasm
23+
run: |
24+
rustup update stable
25+
rustup default stable
26+
rustup set profile minimal
27+
rustup target add wasm32-unknown-unknown
28+
- name: Rust Cache # cache the rust build artefacts
29+
uses: Swatinem/rust-cache@v2
30+
- name: Download and install Trunk binary
31+
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
32+
- name: Build # build
33+
# Environment $public_url resolves to the github project page.
34+
# If using a user/organization page, remove the `${{ github.event.repository.name }}` part.
35+
# using --public-url something will allow trunk to modify all the href paths like from favicon.ico to repo_name/favicon.ico .
36+
# this is necessary for github pages where the site is deployed to username.github.io/repo_name and all files must be requested
37+
# relatively as eframe_template/favicon.ico. if we skip public-url option, the href paths will instead request username.github.io/favicon.ico which
38+
# will obviously return error 404 not found.
39+
run: ./trunk build --release --public-url $public_url
40+
env:
41+
public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
42+
- name: Deploy
43+
uses: JamesIves/github-pages-deploy-action@v4
44+
with:
45+
folder: dist
46+
# this option will not maintain any history of your previous pages deployment
47+
# set to false if you want all page build to be committed to your gh-pages branch history
48+
single-commit: true

.github/workflows/rust.yml

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
on: [push, pull_request]
3+
4+
name: Rust
5+
6+
env:
7+
RUSTFLAGS: -D warnings
8+
RUSTDOCFLAGS: -D warnings
9+
10+
jobs:
11+
rust-check:
12+
name: Rust
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions-rs/toolchain@v1
18+
with:
19+
profile: default
20+
toolchain: 1.76.0
21+
override: true
22+
23+
- name: Install packages (Linux)
24+
if: runner.os == 'Linux'
25+
uses: awalsh128/[email protected]
26+
with:
27+
packages: libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev
28+
version: 1.0
29+
execute_install_scripts: true
30+
31+
- name: Set up cargo cache
32+
uses: Swatinem/rust-cache@v2
33+
34+
- name: Rustfmt
35+
uses: actions-rs/cargo@v1
36+
with:
37+
command: fmt
38+
args: --all -- --check
39+
40+
- name: Lint vertical spacing
41+
run: ./scripts/lint.py
42+
43+
- name: check --all-features
44+
uses: actions-rs/cargo@v1
45+
with:
46+
command: check
47+
args: --all-features --all-targets
48+
49+
- name: check default features
50+
uses: actions-rs/cargo@v1
51+
with:
52+
command: check
53+
args: --all-targets
54+
55+
- name: check --no-default-features
56+
uses: actions-rs/cargo@v1
57+
with:
58+
command: check
59+
args: --no-default-features --lib --all-targets
60+
61+
- name: Test doc-tests
62+
uses: actions-rs/cargo@v1
63+
with:
64+
command: test
65+
args: --doc --all-features
66+
67+
- name: cargo doc --lib
68+
uses: actions-rs/cargo@v1
69+
with:
70+
command: doc
71+
args: --lib --no-deps --all-features
72+
73+
- name: cargo doc --document-private-items
74+
uses: actions-rs/cargo@v1
75+
with:
76+
command: doc
77+
args: --document-private-items --no-deps --all-features
78+
79+
- name: Build tests
80+
uses: actions-rs/cargo@v1
81+
with:
82+
command: test
83+
args: --all-features --no-run
84+
85+
- name: Run test
86+
uses: actions-rs/cargo@v1
87+
with:
88+
command: test
89+
args: --all-features
90+
91+
- name: Clippy
92+
uses: actions-rs/cargo@v1
93+
with:
94+
command: clippy
95+
args: --all-targets --all-features -- -D warnings
96+
97+
# ---------------------------------------------------------------------------
98+
99+
check_wasm:
100+
name: Check wasm32
101+
runs-on: ubuntu-latest
102+
steps:
103+
- uses: actions/checkout@v4
104+
- uses: actions-rs/toolchain@v1
105+
with:
106+
profile: minimal
107+
toolchain: 1.76.0
108+
target: wasm32-unknown-unknown
109+
override: true
110+
111+
- name: Set up cargo cache
112+
uses: Swatinem/rust-cache@v2
113+
114+
- name: Check wasm32
115+
uses: actions-rs/cargo@v1
116+
with:
117+
command: check
118+
args: --target wasm32-unknown-unknown --lib
119+
120+
- name: Clippy wasm32
121+
env:
122+
CLIPPY_CONF_DIR: "scripts/clippy_wasm" # Use scripts/clippy_wasm/clippy.toml
123+
run: cargo clippy --target wasm32-unknown-unknown --lib -- -D warnings
124+
125+
# ---------------------------------------------------------------------------
126+
127+
cargo-deny:
128+
name: Check Rust dependencies (cargo-deny)
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v3
132+
- uses: EmbarkStudios/cargo-deny-action@v1
133+
with:
134+
rust-version: "1.76.0"
135+
log-level: warn
136+
command: check
137+
138+
# ---------------------------------------------------------------------------
139+
140+
trunk:
141+
name: trunk
142+
runs-on: ubuntu-latest
143+
steps:
144+
- uses: actions/checkout@v4
145+
- uses: actions-rs/toolchain@v1
146+
with:
147+
profile: minimal
148+
toolchain: 1.76.0
149+
target: wasm32-unknown-unknown
150+
override: true
151+
- name: Download and install Trunk binary
152+
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
153+
- name: Build
154+
run: ./trunk build

.github/workflows/typos.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copied from https://github.com/rerun-io/rerun_template
2+
3+
# https://github.com/crate-ci/typos
4+
# Add exceptions to `.typos.toml`
5+
# install and run locally: cargo install typos-cli && typos
6+
7+
name: Spell Check
8+
on: [pull_request]
9+
10+
jobs:
11+
run:
12+
name: Spell Check
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Actions Repository
16+
uses: actions/checkout@v4
17+
18+
- name: Check spelling of entire workspace
19+
uses: crate-ci/typos@master

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Mac stuff:
2+
.DS_Store
3+
4+
# trunk output folder
5+
dist
6+
7+
# Rust compile target directories:
8+
target
9+
target_ra
10+
target_wasm
11+
12+
# https://github.com/lycheeverse/lychee
13+
.lycheecache

.typos.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://github.com/crate-ci/typos
2+
# install: cargo install typos-cli
3+
# run: typos
4+
5+
[default.extend-words]
6+
egui = "egui" # Example for how to ignore a false positive

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
All notable changes to the `egui_plot` integration will be noted in this file.
33

44
This file is updated upon each release.
5-
Changes since the last release can be found at <https://github.com/emilk/egui/compare/latest...HEAD> or by running the `scripts/generate_changelog.py` script.
5+
Changes since the last release can be found at <https://github.com/emilk/egui_plot/compare/latest...HEAD> or by running the `scripts/generate_changelog.py` script.
66

77

88
## 0.28.1 - 2024-07-05

0 commit comments

Comments
 (0)