Skip to content

Commit 5c4f86a

Browse files
authored
Touch (#4)
1 parent 66d8b16 commit 5c4f86a

24 files changed

+199
-128
lines changed

.github/workflows/audit-rust.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Security audit
2+
on:
3+
push:
4+
paths:
5+
- '**/Cargo.toml'
6+
- '**/Cargo.lock'
7+
jobs:
8+
security_audit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions-rs/audit-check@v1
13+
# FIXME: needs to cd into ./marauder https://github.com/actions-rs/audit-check/issues/116
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-rust.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
on: [push, pull_request]
2+
3+
name: Continuous integration
4+
5+
jobs:
6+
check:
7+
name: Check
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions-rs/toolchain@v1
12+
with:
13+
profile: minimal
14+
toolchain: nightly
15+
target: armv7-unknown-linux-gnueabihf
16+
override: true
17+
components: rustfmt
18+
- run: make ujipenchars2.txt
19+
working-directory: marauder
20+
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
21+
with:
22+
working-directory: marauder
23+
use-cross: true
24+
args: --target armv7-unknown-linux-gnueabihf
25+
command: check
26+
27+
test:
28+
name: Test Suite
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: actions-rs/toolchain@v1
33+
with:
34+
profile: minimal
35+
toolchain: nightly
36+
target: armv7-unknown-linux-gnueabihf
37+
override: true
38+
components: rustfmt
39+
- run: make ujipenchars2.txt
40+
working-directory: marauder
41+
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
42+
with:
43+
working-directory: marauder
44+
use-cross: true
45+
args: --target armv7-unknown-linux-gnueabihf
46+
command: test
47+
48+
fmt:
49+
name: Rustfmt
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v2
53+
- uses: actions-rs/toolchain@v1
54+
with:
55+
profile: minimal
56+
toolchain: nightly
57+
target: armv7-unknown-linux-gnueabihf
58+
override: true
59+
components: rustfmt
60+
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
61+
with:
62+
working-directory: marauder
63+
command: fmt
64+
args: --all -- --check
65+
66+
clippy:
67+
name: Clippy
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v2
71+
- uses: actions-rs/toolchain@v1
72+
with:
73+
profile: minimal
74+
toolchain: nightly
75+
target: armv7-unknown-linux-gnueabihf
76+
override: true
77+
components: rustfmt, clippy
78+
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
79+
with:
80+
working-directory: marauder
81+
use-cross: true
82+
args: --target armv7-unknown-linux-gnueabihf -- -D warnings
83+
command: clippy

.github/workflows/whiteboard.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/workflow.yml

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
on: [push]
22
name: Build for reMarkable
33
jobs:
4+
45
build_for_remarkable:
56
name: with musl
67
runs-on: ubuntu-latest
@@ -11,15 +12,49 @@ jobs:
1112
toolchain: nightly # TODO: stable once const-fn is in
1213
target: armv7-unknown-linux-musleabihf
1314
override: true
14-
- run: rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
15-
- run: make ujipenchars2.txt
16-
working-directory: marauder
17-
- run: make test
18-
working-directory: marauder
15+
components: rustfmt
16+
# TODO: following fails with error occurred: Failed to find tool. Is `arm-linux-gnueabihf-gcc` installed?
17+
# - uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
18+
# with:
19+
# use-cross: true
20+
# command: build
21+
# working-directory: marauder
22+
# args: --release --frozen --locked --offline --target armv7-unknown-linux-musleabihf
23+
# continue-on-error: true
24+
25+
whiteboard_hypercard:
26+
name: Whiteboard HyperCard
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: nightly
33+
target: armv7-unknown-linux-gnueabihf
34+
override: true
35+
components: rustfmt
1936
- uses: marcopolo/cargo@master # TODO: - uses: actions-rs/cargo@v1 https://github.com/actions-rs/cargo/pull/59
2037
with:
38+
working-directory: marauder
2139
use-cross: true
2240
command: build
23-
working-directory: marauder
24-
args: --release --frozen --locked --offline --target armv7-unknown-linux-musleabihf
25-
continue-on-error: true
41+
args: --target armv7-unknown-linux-gnueabihf --release --bin whiteboard --locked #--frozen #--offline
42+
- if: startsWith(github.ref, 'refs/tags/')
43+
id: create_release
44+
uses: actions/create-release@v1
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
tag_name: ${{ github.ref }}
49+
draft: false
50+
prerelease: false
51+
- if: startsWith(github.ref, 'refs/tags/')
52+
id: upload-release-asset
53+
uses: actions/upload-release-asset@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
upload_url: ${{ steps.create_release.outputs.upload_url }}
58+
asset_path: ./marauder/target/armv7-unknown-linux-gnueabihf/release/whiteboard
59+
asset_name: whiteboard
60+
asset_content_type: application/octet-stream

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,8 @@ Visible rectangular elements that can be drawn/moved/zoomed/rotated/connected/du
8686
* https://en.wikipedia.org/wiki/TRIZ
8787
* https://eugeneyan.com/2020/04/05/note-taking-zettelkasten/
8888
* https://github.com/alexandre01/deepsvg
89+
90+
## Donation
91+
92+
Feel free to donate to me through paypal.me/pierrefenoll1
93+
Make sure to describe what I should be working on :)

marauder/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

marauder/Makefile

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
# rustup target add armv7-unknown-linux-musleabihf --toolchain=nightly
44
# cargo install cross
55

6-
TARGET = armv7-unknown-linux-musleabihf
6+
# TARGET ?= armv7-unknown-linux-musleabihf
7+
TARGET ?= armv7-unknown-linux-gnueabihf
78
EXE = marauder
89
BIN = ./target/$(TARGET)/release/$(EXE)
9-
IMG ?= rust-build-remarkable:latest
1010
DEVICE ?= remarkable
1111
RUN ?= docker run --rm --user $$(id -u):$$(id -g)
1212
FLATC ?= $(RUN) -v "$$PWD"/src:/src -v "$$PWD"/src:/dst neomantra/flatbuffers:clang-v1.12.0-cc0.6.0 flatc
1313

1414
all: src/strokes/strokes_generated.rs lint
15-
cross build --release --target=$(TARGET)
15+
cross build --target=$(TARGET) --release
1616
ls -lh $(BIN)
1717

1818
fmt:
1919
cargo fmt
2020

2121
lint: fmt
22-
cross clippy --target=$(TARGET)
22+
cross clippy --target=$(TARGET) #-- -W clippy::pedantic
2323

2424
test: fmt test-ujipenchars2
2525
cargo test
@@ -33,7 +33,6 @@ test-ujipenchars2: ujipenchars2.txt
3333
update:
3434
cargo update
3535

36-
debug: DEVICE ?= root@10.11.99.1
3736
debug: all
3837
ssh $(DEVICE) 'killall -q -9 $(EXE) || true; systemctl stop xochitl || true'
3938
scp -pC $(BIN) $(DEVICE):
@@ -42,31 +41,10 @@ debug: all
4241
src/strokes/strokes_generated.rs: src/strokes/strokes.fbs
4342
$(FLATC) --rust -o /dst/strokes /$^
4443

45-
.PHONY: docker-env
46-
docker-env:
47-
cd docker-toolchain && docker build \
48-
--build-arg UNAME=builder \
49-
--build-arg UID=$(shell id -u) \
50-
--build-arg GID=$(shell id -g) \
51-
--build-arg ostype=${shell uname} \
52-
--tag $(IMG) .
53-
54-
whiteboard: DEVICE ?= root@10.11.99.1
5544
whiteboard: HOST ?= http://fknwkdacd.com:10000
5645
whiteboard: EXE = whiteboard
57-
whiteboard: BIN = ./target/armv7-unknown-linux-gnueabihf/release/$(EXE)
58-
whiteboard: VOLUME ?= cargoregistry
59-
whiteboard: fmt docker-env
60-
docker volume inspect $(VOLUME) >/dev/null 2>&1 || docker volume create $(VOLUME)
61-
# TODO: https://github.com/toltec-dev/toolchain/issues/2
62-
docker run \
63-
-it --rm \
64-
--user builder \
65-
-v "$$PWD":/home/builder/libremarkable:rw \
66-
-v $(VOLUME):/home/builder/.cargo/registry \
67-
-w /home/builder/libremarkable \
68-
$(IMG) \
69-
cargo build --release --bin $(EXE) --target=armv7-unknown-linux-gnueabihf #--locked #--frozen #--offline
46+
whiteboard: fmt
47+
cross build --target=$(TARGET) --release --bin $(EXE) #--locked #--frozen #--offline
7048
ssh $(DEVICE) 'killall -q -9 $(EXE) || true; systemctl stop xochitl || true'
7149
scp -pC $(BIN) $(DEVICE):
7250
ssh $(DEVICE) 'RUST_BACKTRACE=1 RUST_LOG=debug ./$(EXE) --host=$(HOST) | tail -f'

marauder/docker-toolchain/Dockerfile

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)