Skip to content

Commit ccb40ec

Browse files
authored
Initial commit
0 parents  commit ccb40ec

27 files changed

+4966
-0
lines changed

.github/workflows/pages.yml

Lines changed: 48 additions & 0 deletions
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

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
on: [push, pull_request, workflow_dispatch]
2+
3+
name: CI
4+
5+
env:
6+
RUSTFLAGS: -D warnings
7+
RUSTDOCFLAGS: -D warnings
8+
9+
jobs:
10+
check:
11+
name: Check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions-rs/toolchain@v1
16+
with:
17+
profile: minimal
18+
toolchain: stable
19+
override: true
20+
- uses: actions-rs/cargo@v1
21+
with:
22+
command: check
23+
args: --all-features
24+
25+
check_wasm:
26+
name: Check wasm32
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions-rs/toolchain@v1
31+
with:
32+
profile: minimal
33+
toolchain: stable
34+
target: wasm32-unknown-unknown
35+
override: true
36+
- uses: actions-rs/cargo@v1
37+
with:
38+
command: check
39+
args: --all-features --lib --target wasm32-unknown-unknown
40+
41+
test:
42+
name: Test Suite
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: actions-rs/toolchain@v1
47+
with:
48+
profile: minimal
49+
toolchain: stable
50+
override: true
51+
- run: sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev
52+
- uses: actions-rs/cargo@v1
53+
with:
54+
command: test
55+
args: --lib
56+
57+
fmt:
58+
name: Rustfmt
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: actions-rs/toolchain@v1
63+
with:
64+
profile: minimal
65+
toolchain: stable
66+
override: true
67+
components: rustfmt
68+
- uses: actions-rs/cargo@v1
69+
with:
70+
command: fmt
71+
args: --all -- --check
72+
73+
clippy:
74+
name: Clippy
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
- uses: actions-rs/toolchain@v1
79+
with:
80+
profile: minimal
81+
toolchain: stable
82+
override: true
83+
components: clippy
84+
- uses: actions-rs/cargo@v1
85+
with:
86+
command: clippy
87+
args: -- -D warnings
88+
89+
trunk:
90+
name: trunk
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v4
94+
- uses: actions-rs/toolchain@v1
95+
with:
96+
profile: minimal
97+
toolchain: 1.81.0
98+
target: wasm32-unknown-unknown
99+
override: true
100+
- name: Download and install Trunk binary
101+
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
102+
- name: Build
103+
run: ./trunk build
104+
105+
build:
106+
runs-on: ${{ matrix.os }}
107+
strategy:
108+
fail-fast: false
109+
matrix:
110+
include:
111+
- os: macos-latest
112+
TARGET: aarch64-apple-darwin
113+
114+
- os: ubuntu-latest
115+
TARGET: aarch64-unknown-linux-gnu
116+
117+
- os: ubuntu-latest
118+
TARGET: armv7-unknown-linux-gnueabihf
119+
120+
- os: ubuntu-latest
121+
TARGET: x86_64-unknown-linux-gnu
122+
123+
- os: windows-latest
124+
TARGET: x86_64-pc-windows-msvc
125+
EXTENSION: .exe
126+
127+
steps:
128+
- name: Building ${{ matrix.TARGET }}
129+
run: echo "${{ matrix.TARGET }}"
130+
131+
- uses: actions/checkout@master
132+
- name: Install build dependencies - Rustup
133+
run: |
134+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile default --target ${{ matrix.TARGET }} -y
135+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
136+
137+
# For linux, it's necessary to use cross from the git repository to avoid glibc problems
138+
# Ref: https://github.com/cross-rs/cross/issues/1510
139+
- name: Install cross for linux
140+
if: contains(matrix.TARGET, 'linux')
141+
run: |
142+
cargo install cross --git https://github.com/cross-rs/cross --rev 1b8cf50d20180c1a394099e608141480f934b7f7
143+
144+
- name: Install cross for mac and windows
145+
if: ${{ !contains(matrix.TARGET, 'linux') }}
146+
run: |
147+
cargo install cross
148+
149+
- name: Build
150+
run: |
151+
cross build --verbose --release --target=${{ matrix.TARGET }}
152+
153+
- name: Rename
154+
run: cp target/${{ matrix.TARGET }}/release/eframe_template${{ matrix.EXTENSION }} eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
155+
156+
- uses: actions/upload-artifact@master
157+
with:
158+
name: eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
159+
path: eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
160+
161+
- uses: svenstaro/upload-release-action@v2
162+
name: Upload binaries to release
163+
if: ${{ github.event_name == 'push' }}
164+
with:
165+
repo_token: ${{ secrets.GITHUB_TOKEN }}
166+
file: eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
167+
asset_name: eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
168+
tag: ${{ github.ref }}
169+
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}
170+
overwrite: true

.github/workflows/typos.yml

Lines changed: 19 additions & 0 deletions
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

Lines changed: 13 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

0 commit comments

Comments
 (0)