Skip to content

Commit

Permalink
Merge branch 'main' into fix_spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored Jun 26, 2024
2 parents 5edc84e + d2bb6a7 commit 0be46b1
Show file tree
Hide file tree
Showing 14 changed files with 403 additions and 43 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Github Pages

# By default, runs if you push to master. keeps your deployed app in sync with master branch.
# By default, runs if you push to main. keeps your deployed app in sync with main branch.
on:
push:
branches:
- master
- main
# to only run when you do a new github release, comment out above part and uncomment the below trigger.
# on:
# release:
Expand All @@ -30,12 +30,15 @@ jobs:
- name: Download and install Trunk binary
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
- name: Build # build
# "${GITHUB_REPOSITORY#*/}" evaluates into the name of the repository
# Environment $public_url resolves to the github project page.
# If using a user/organization page, remove the `${{ github.event.repository.name }}` part.
# using --public-url something will allow trunk to modify all the href paths like from favicon.ico to repo_name/favicon.ico .
# this is necessary for github pages where the site is deployed to username.github.io/repo_name and all files must be requested
# relatively as eframe_template/favicon.ico. if we skip public-url option, the href paths will instead request username.github.io/favicon.ico which
# will obviously return error 404 not found.
run: ./trunk build --release --public-url "${GITHUB_REPOSITORY#*/}"
run: ./trunk build --release --public-url $public_url
env:
public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
82 changes: 72 additions & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

name: CI

env:
# This is required to enable the web_sys clipboard API which egui_web uses
# --cfg=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
RUSTFLAGS: -D warnings --cfg=web_sys_unstable_apis
RUSTDOCFLAGS: -D warnings

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -28,7 +29,7 @@ jobs:
name: Check wasm32
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -44,7 +45,7 @@ jobs:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -60,7 +61,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -76,7 +77,7 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -92,14 +93,75 @@ jobs:
name: trunk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.72.0
toolchain: 1.76.0
target: wasm32-unknown-unknown
override: true
- name: Download and install Trunk binary
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
- name: Build
run: ./trunk build

build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
TARGET: aarch64-apple-darwin

- os: macos-latest
TARGET: x86_64-apple-darwin

- os: ubuntu-latest
TARGET: arm-unknown-linux-musleabihf

- os: ubuntu-latest
TARGET: armv7-unknown-linux-musleabihf

- os: ubuntu-latest
TARGET: x86_64-unknown-linux-musl

- os: windows-latest
TARGET: x86_64-pc-windows-msvc
EXTENSION: .exe

steps:
- name: Building ${{ matrix.TARGET }}
run: echo "${{ matrix.TARGET }}"

- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1.0.1
with:
toolchain: stable
target: ${{ matrix.TARGET }}
override: true

- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --verbose --release --target=${{ matrix.TARGET }}

- name: Rename
run: cp target/${{ matrix.TARGET }}/release/eframe_template${{ matrix.EXTENSION }} eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}

- uses: actions/upload-artifact@master
with:
name: eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
path: eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}

- uses: svenstaro/upload-release-action@v2
name: Upload binaries to release
if: ${{ github.event_name == 'push' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
asset_name: eframe_template-${{ matrix.TARGET }}${{ matrix.EXTENSION }}
tag: ${{ github.ref }}
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}
overwrite: true
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
15 changes: 13 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
/target
/dist
# Mac stuff:
.DS_Store

# trunk output folder
dist

# Rust compile target directories:
target
target_ra
target_wasm

# https://github.com/lycheeverse/lychee
.lycheecache
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]
egui = "egui" # Example for how to ignore a false positive
50 changes: 34 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ name = "eframe_template"
version = "0.1.0"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
edition = "2021"
rust-version = "1.72"
include = ["LICENSE-APACHE", "LICENSE-MIT", "**/*.rs", "Cargo.toml"]
rust-version = "1.76"

[package.metadata.docs.rs]
all-features = true
targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]

[dependencies]
egui = "0.25.0"
eframe = { version = "0.25.0", default-features = false, features = [
egui = "0.27.0"
eframe = { version = "0.27.0", default-features = false, features = [
"accesskit", # Make egui compatible with screen readers. NOTE: adds a lot of dependencies.
"default_fonts", # Embed the default egui fonts.
"glow", # Use the glow rendering backend. Alternative: "wgpu".
Expand Down
Loading

0 comments on commit 0be46b1

Please sign in to comment.