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

feat(rrp): web client #16

Merged
merged 40 commits into from
Aug 23, 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
6 changes: 5 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ inherits = "release"
opt-level = "z"
lto = true
panic = "abort"
rustflags = ["-Zlocation-detail=none"]
# rustflags = ["-Zlocation-detail=none"]
strip = true

[alias]
custom-ra-check = "make ra-check"

[env]
RKTK_CONFIG_PATH = { value = "keyboards/rktk.keyball.toml", relative = true }

[build]
rustflags = ["--cfg=web_sys_unstable_apis"]

43 changes: 0 additions & 43 deletions .github/workflows/ci.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: lib

on:
push:
branches: ["master"]
paths:
- '.github/workflows/lib.yml'
- '**.toml'
- '**.rs'
- '**.lock'
pull_request:
paths:
- '.github/workflows/lib.yml'
- '**.toml'
- '**.rs'
- '**.lock'

env:
CARGO_TERM_COLOR: always

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup rust
uses: ./.github/workflows/setup-rust
with:
components: "clippy,rust-src"
target: "thumbv6m-none-eabi,thumbv7em-none-eabihf"
tools: "cargo-make"

- name: Run rust check
run: cargo make check-all

test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup rust
uses: ./.github/workflows/setup-rust
with:
components: "rust-src"
target: ""
tools: "cargo-make"

- name: Run rust test
run: cargo make test-all
51 changes: 51 additions & 0 deletions .github/workflows/rrp-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: rrp-web

on:
push:
branches: ["master"]
paths:
- 'rrp-web/**'
- '.github/workflows/rrp-web.yml'
pull_request:
paths:
- 'rrp-web/**'
- '.github/workflows/rrp-web.yml'

env:
CARGO_TERM_COLOR: always

jobs:
rrp-web-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup rust
uses: ./.github/workflows/setup-rust
with:
components: "rust-src"
target: "wasm32-unknown-unknown"
tools: "wasm-pack"

- name: Build rust library
run: cd rrp-web/rrp-client-web && wasm-pack build --release

- uses: pnpm/action-setup@v4
name: Setup pnpm
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: rrp-web/pnpm-lock.yaml

- name: pnpm install
run: cd rrp-web && pnpm install

- name: Type check rrp-web
run: cd rrp-web && pnpm tsc --noEmit
35 changes: 35 additions & 0 deletions .github/workflows/setup-rust/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Setup Rust

description: "Setup Rust toolchain"

inputs:
components:
description: 'rustup components to install'
required: true
target:
description: 'rustup target to install'
required: true
tools:
description: 'tools to install'
required: true

runs:
using: "composite"
steps:
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: "nightly-2024-08-23"
components: "${{ inputs.components }}"
targets: "${{ inputs.target }}"

- id: rust-override
shell: bash
run: "rustup override set ${{steps.toolchain.outputs.name}}"

- uses: Swatinem/rust-cache@v2

- name: Install cargo deps
uses: taiki-e/install-action@v2
with:
tool: "${{ inputs.tools }}"
Loading